Here's less reasonable advice that I've also found works well: bait toxic people into bad behavior.
Figure out what gets the biggest response out of them while looking super reasonable yourself. Try to get them fired up as much as possible so they're annoying everyone, especially their manager, and not just you. The more people angry with the toxic person, the shorter their lifespan.
Give them enough rope to hang themselves.
Trolling is a art.
Many bullies bully as a way of taking control. They tend to pick easy targets that won't have consequences. Normally it's backed with some moral shield, which is why bullies tend to pick on anti-vax, vegans, animal haters, people who say dumb things on social media, people who store passwords in plaintext, tyrants, people with messy code.
A bully will pick on an unpopular manager, but not a well-liked one. But they'll only do this if they believe they'd be backed.
The trick is to be nice as a way to show that you don't fear them. Don't give them your lunch, but sharing a slice of fruit is fair. It's also very difficult for them to bully someone who is well-liked.
Appeasement might reinforce that you are an easy, no-consequences target. Forced niceness is just as bad. But something like thanking them for correcting you, or for finishing a task, that's fine.
I've read an article that toxic coworkers actually do affect performance so I know this is hard.
But, in my experience, I wasn't exactly NICE but I was genuinely trying to be helpful, and sensitive to whatever the team needs. In the end, all I got was respect not only from him but from the team, which is the only thing I need.
A standard tactic is to be genuinely nice to them. You don't have to like them, but being polite makes them look worse when they are not. You can even be generous to them. This might actually give you some insight to why he acts that way. I've had issues with some coworkers who insecure in a job they badly needed, or some who have a grudge against someone else in the team for a good reason.
If you do fight back, make sure you can land a solid hit. Argue when you're clear that you're right, and make them explain where they think you're wrong. A solid hit will discourage them next time.
The trick with office politics is that you also need more people on your side. Be friends with the people he's picking on. It sounds like you're isolated. Wolves avoid herds.
If all else fails, learn to be unbothered like your managers have. Sometimes you have to treat them like children, which is to smile and nod as they tantrum. Sometimes you treat them like an environmental hazard, like a puddle of urine in the bathroom where it's not your job to clean after.