Regarding the point (2) I'll try to clarify it by pictures:
The joystick should always be attached in a way where exactly half of the half-ball part is sticking out of the target panel/wall/box/whatever. Whether one decides to support it from the top like on the second picture or from the bottom does not matter. The half of the half-ball part should always be sticking out, not more, not less.
(3) I actually do not have the size of the opening. I can calculate it from the radius of the half-ball part. But it would be easier to make an intersection with a plane cuting through a half of the half-ball part then geting the outer wire and then doing 2D offset to enlarge it just a little.
Or I can prepare much more complicated geometry than a circle. Make a part which should be cut away from the target!
the `def cutaway(self):`. In that specific example it is something like a bounding cylinder i.e. without the middle hole.
I image making similar thing for the joystick instead of a preparing just a circle.
If one cuts out such solid from the target thing it won't matter whether it is a thin panel (where it will make more or less a hole) or a big solid brick (where it will make a nice pocket, although with no way to place the joystick into it without additional modelling).