There are so many reasons a horse would come completely apart upon mounting. First rule out a physical pain issue. That can be the issue but often times it's actually lack of training.
Top of mind would be--
green horse not settled in training and needs much more
lack of focus on rider and horse sees "squirrel" equivalent and doesn't know how to spook in place
buddy sour and focused on buddies leaving and just can't keep it together
started horse hasn't been ridden much in months over winter so acts like green horse
I just rode my horse for one of his first rides since October. I treated him like a green horse and we did ground work the days before the ride. I tacked him and hand lead him over the ground I would ride. I practiced standing for mounting. All of this took hours before I put my foot in the stirrup. Obviously he's a well started horse so I could go faster than a totally green horse. But, he did have issues with parts. Reminded me not to take him for granted. Prior preparation prevents piss poor performance. He did have a minor spook but kept his focus on me and for him, he did just fine. My horse is 12 too and has many many miles on him. But, it's spring and he hasn't been ridden or handled much. Prepare, prepare, prepare.
PS. When mounting have your horse check in with you, attend to you, tip their face toward you, grab mane with the rein hand, put foot in stirrup, double check horse is okay and calm, put weight in stirrup and gently swing on, release horse and flex each direction, rub all over, pause a minute, get organized, walk on.