If you have a fully insulated enclosure, then feeding mains into it is OK , the problem comes when there are areas of possible contacts by people of a path to the inner workings. So you have a mains fed SMPS charging a battery, feeding an inverter producing mains output. At the output, the mains wiring is always insulated, so no further isolation is required BUT the safety earth must be taken right through the system so a piece of plant connected to the output is physicaly connected to the incoming mains earth. If the output was taken from the battery , as battery wiring does not provide mains insulation, the battery charging side inside your box would have to do this, by providing the isolation required.
An old fashioned case would be old AC/DC TV sets where one side of the mains is directly connected to the metal chassis. All the knobs are insulated but the aerial input panel where there needs to a good RF earth for the aerial, is insulated and both the live aerial feed and the earth for the aerial are fed via special high voltage capacitors of a low value, so the 50HZ appearing on them is mimimal.
Often a capacitor is require for stability purposes between the live circuit and the metalwork of a SMPS. This must be of the correct type, failure of it will make the metalwork become live.
Frank