Patrick, I'm going to take a stab at it, simply by sharing what I've come up with and against. Perhaps something here and there will give you insights.
My quest has gone along two fronts. When I was a child I was given a piano, some books, nobody to ever see play, and my "technique" developed from there. When I was 18 I lost the piano, and didn't have one again for over 35 years. It also turns out that the music I was given as a child, (sonatinas, mostly Clementi), also set my hand rather rigidly in one pattern. ... Then as a middle aged adult I got violin lessons, and things went wrong on the technical front. To get out of it I chased "form" for the first time. It probably made some diagnosing harder, since I was "picture perfect". Then got a piano, knew technique mattered, and that's where I am now.
Focusing on the word "picture perfect", and zooming in on the word "picture". You sent two pictures, and you asked about your form. There may or may not be a clue here. Playing music is movement and that is a very important component. When I chased "form", this is in fact an important component. But if other factors are at play, then by not addressing them, you can miss those problems. Also, one can aim for form in a sense of "shaping oneself" into a good form, when in actual fact everything is in constant motion. That "going into the right shape" as it were, can create its own rigidity.
Going on to other factors
- There is sitting at the right height and distance, as you've been exploring. But also, as you play in different areas of the keyboard you can lean in, lean back, sideways, turn a bit to the left or right. I got ulnar deviation coupled with discomfort when I played mid-piano, because I stayed in close like when I was playing in the far reaches. It was such an obvious thing, once I realized!
- I'd "line up the hands" so that they were parallel with the cracks between notes or at right angles (subconsciously) when in fact the hands can be angled and should be free to be angled. If your pinky is far into the keyboard and thumb at the edge, that's quite angled. This "lining up" created quite a kink at the wrist.
- The hands can move in and out from the black keys. I didn't necessarily give myself that freedom either. In fact, I seemed to have some kind of "narrow geography" going on.
- Movement and amoeba like shape changing, a kind of constant motion, so that when you've landed on one note, your hand is already starting to change its angles and shapes for the next note. By "hand" I include the entire apparatus
- What's happening with the rest of your body? Do you feel a role for your feet? Are you "holding yourself up" with your back, so that the muscles that feed into your arms are busy holding you up? Hips and (shifting) balance on the piano bench?
What I have listed are the issues that I have been sorting out. One principle I learned is that "everything must always be free to move at least a little bit, and everything should be moving at least a little bit". If you try for a correct shape, that by its very definition, is immobility. For me it's been a tough nut to crack.