The NEC (National Electric Code) forbids electrical wires through walls.
We specifically mention this in our documentation for UL compliance:
See page 10 of the MegaDrive user manual.
In order to go through a wall and still be compliant, the easiest way is to install a fire barrier kit such as this one:
Shop EZ Path® Series 22 Firestop Pathway Kit, 1-2 Hours By Specified Technologies (EZD22) At Graybar, Your Trusted Resource For Firestop Products And Other Specified Technologies Products.
These are UL approved and allow cables to go through walls.
The other option is to use 2 junction boxes on either end of the wall with a piece of conduit connecting the 2.