I have a similar issue. Our pony was great when we went to look at her before we bought her. Chilled out, easy going, didn't bat an eyelid when I picked up all four feet, felt over her legs etc, even stood placid while two dogs had a fight nearby. Great, I thought, nice pony, we took her on trial. She loaded perfectly, travelled well, no probs. BUT, like in your case, her owner was always there in sight.
Got her home, she was hard to catch, spooked and ran when you moved around her, quivered in fear at the dogs, acted like she'd never seen a saddle let alone worn one.
I thought I'd been duped, maybe she'd been drugged when we'd seen her.
We started training her from scratch, catching, haltering, desensitizing, picking up feet etc etc and she began to get back on track. Spoke to the girl we were buying her from and she was astounded at how Rose was behaving. She came over to visit and Rose went back to being the horse we'd seen that first day !!
Turned out she'd never had anyone else do anything much with the pony. He family weren't horse people and Rose had been paddock boarded at a property. The poor pony lost her security when she lost her owner
Now, Rose is getting a LOT better. She is great for me and DD, but still has issues with other people. We are working on it but its slow going. Luckily we have no intention of Rose being anything other than a farm pony. She is 13 so we may never train this out of her, hopefully you can prevent your horse from getting this way.