Where in the NEC does it say where you cannot install electrical panels? I recall a bathroom being one of the restricted location.
That is true for residential panels and service panels. Actually it is the overcurrent protective device that is not allowed. Section 240.24(E). Section 240.24 will also give you other areas where overcurrent protective device are not to be installed
Identify the problem FIX IT. Identify another problem FIX IT. Repeat as necessary till it is all FIXED.