This is definitely a unique situation. Someone created an electrical problem when they installed this railing. Section 406.9(B)(2) of the 2017 NEC requires receptacles to be housed in a weatherproof enclosure. Since this cover can no longer be closed we have a Code violation. Russ also points out that since the wiring in this box is no longer accessible, this creates a violation of Sec. 314.29.