I just bought a new 220V lathe. Of course, its cord would not reach the closest 220v shop outlet. The (Jet) lathe manual, it gave specs for wire gauge at ranges of length for using extension cords. That, to whatever degree may debunk the Googled prohibition of 220v extension cords. I only needed another 12 feet but I still went up a notch to 12g SJ wire (from Lowes). Fancy appearance was not an issue, so I too used a metal utility box and metal cover with the correct and high-grade 220v receptacle. A high-grade plug on the other end completed things, adding up to a surprisingly expensive extension cord.
Assembling the components and with care is, of course, essential. As others have said, if the wire and components meet or exceeds the needs of the draw in amps and if things are assembled correctly and securely, I know of no incremental risk.
As Mike Davis wisely suggested, replacing the appliance’s cord with a longer one of equal or greater gauge wire with a good 220v plug is an ideal approach. This method introduces no additional points of connection. The rewiring still has to be done prudently though. I chose an extension cord because I didn’t want to break into the lathe’s VFD inverter.
With all that said, If there’s an electrician out there that can chime in on either side of this, I’m all