I had parts of it commented for now, as I seemed stuck with what I could reasonably do, but the code was basically this:
SetObjectPosition(door,20,12.5,55.3)
SetObjectScalePermanent(door,1,1,1)
SetObjectImage(door,doorxt,0)
SetObjectRotation(door,0,-140,0)
Create3DPhysicsDynamicBody(door)
SetObjectShapeStaticPolygon(door)
SetObjectCastShadow(door,1)
SetObjectReceiveShadow(door,1)
SetObject3DPhysicsCanSleep(door,0)
post = CreateObjectCylinder(20,1,15)
SetObjectColor(post,100,100,100,255)
SetObjectPosition(post,19,11,55)
Create3DPhysicsStaticBody(post)
hingeJnt = Create3DPhysicsHingeJoint(post,door, CreateVector3(20,14,56),CreateVector3(0,1,0),1)
Set3DPhysicsJointHingeLimits(hingeJnt,-90,90)
The thing that is important to note is how the wall with the hole for the door is actually also an object using a StaticPolygon physics shape (this is required otherwise you would not be able to move through the door way hole).
My guess is that the automatically created physics shape, that's polygonal, for the door, can't match the hole well enough for it to not 'be created' within the other physics object being the wall with the hole for the door.
The more I messed with the model itself, the less the rotation of the door in terms of it's axis made any sense. And the closer the values for positions would match, the more the door would glitch out as seen in the video.
Note: I am aware the door probably should be a physics object that has a box physics shape or maybe a convexhull to not have a static physics object do 'dynamic physics body' things, however literally the only way I can achieve a polygon-accurate physics shape that matches the door accurately (yes, even despite being basically just a simple box shape) is using SetObjectShapeStaticPolygon.
I would love to see the actual physics shape the engine generates for my model to be honest. because maybe there's something glitching there which shouldn't normally cause problems but somehow does. I do use MagickaVoxel to create models, which isn't quite 'clever' in how it merges the cubes you create with it. However, none of my other models made with that ever gave a problem. All of them are accurate down to the cube faces in terms of physics collisions using StaticPolygon where such a physics shape makes sense or in rare cases is required (think about physics collisions within a box or the hole of a window, or a kitchen sink thing that's also part of a wall).
Anyway, long story short, I am open to any and all suggestions. I kind of would love to implement a door like this in my game.