I have no issue with your plan, indeed, it's something I like, and have done several times. I have seen it work out very well in the most demanding environments.

Too bad it's against code.

The NEC requires pendant receptacles to be in a box with a threaded hub.

Idiocy, IMO. I think they MEANT to preclude the use of simple 4-square boxes, or it was an 'end run' to try to ban DIY extension cords. Yet, in the process, they banned the common cord cap.