You also need to consider that your horse isn't so much acting up because he's naughty and fighting you but because he likely isn't used to being worked alone - a lot of horses spend their entire working life just following the horse in front and never know how to be ridden independently
Now he's suddenly in a strange place with an owner he hasn't learnt to trust yet and being asked to do things he has no clue about and he's so stressed he's doing the only thing he can think of and that's to get back to where he feels secure - the barn and his horse friends
It might be better for you both if you could just spend some time getting used to each other while riding out on trails with another horse and then spend just short amounts of time working him on his own in the ménage or around the outside of the barn.
Punishing him for something he doesn't understand will only make him worse. He will resent going in the school even more as he'll associate it with something bad
You don't say how much experience you have with problem horses but it could just be that you are in over your head here and working with a good trainer might help.
Another thought - if you were told the horse was safe and quiet and he's turned out not to be, it might be better to speak to them and discuss exchanging him for one that really does what you want it too.
I know it might feel like giving up but no point getting seriously hurt.