I had an OTTB, 7 years old, he was extremely unpredictable! A lot of the things you are describing, random bucking (the whole length of a dressage arena!) and at times rearing. He never came up lame but after taking him to the vet it was discovered that he had arthritis which was probably making him uncomfortable leading to the unacceptable behavior.
I now have a Dutch Warmblood mare, when I first got her she was extremely spooky and I had a horrible time trusting her. At one point I was too nervous to even ride her. Eventually I started riding with a new trainer who told me to just ride my horse! I stopped worrying about what was going to happen next and started focusing on keeping her mind busy. Over time we have both learned to trust each other and 8 years later we are a solid pair with much less spooking. My suggestion is find a good trainer who can help give you both confidence and like the person said above, relax 🙂 This is a tough situation but with a lot of hard work you can get through it.