Studs spacing too close together to put in sub panel in workshop basement
Simply surface mount the panel, then it doesn't matter what the stud spacing is behind it. You'll put a piece of plywood on the surface of the wall, screw it into the studs, then screw the panel to the plywood, and Bob's your uncle!
Once you've got the surface mounted panel, you can then run a chase from floor to ceiling (thanks for the reminder, George!), framing it with 2x4 or 2x6 (as dictated by the size of your box, since this won't be structural) and covering it (the chase, not the panel) with drywall, or, even better a removable panel for easy access for future wiring updates and giving you a very nice place to hide all your wiring, as well as &quot;embedding&quot; the panel in a &quot;wall&quot; structure. Sure, it'll stick out into the room, but it will enclose all the wiring and eliminate the need to run conduit and all the complications that can entail. (Yes, there are some who prefer conduit for everything, and places where it's required for everything, but when it's not required and you're not comfortable working with it, it can be an extra hassle when not needed.)
If you want the panel to be flush mount into a load-bearing wall, then you'll need to provide a temporary support the floor above, cut a stud to make a cavity big enough for the panel, install a properly sized header, install jack studs to support the header, remove the temporary support, then install the panel in the wall
If you go the in-wall route, you'll have to run all wiring through the header (not sure of the code implications of that), or they'll have to go out the top of the panel, immediately turn to go through the studs supporting the panel, then go up.
Alternatively, you could look to see if you could find a narrower panel that will fit your gap.