That sucks, man. Sorry to hear that.
I've had several Star Wars
figures topple over or accidentally get stepped on and wind up with loose or detached limbs or heads. Some characters are so flimsy and lightweight(Battle Droids and Geonosians from the prequels for example) that the slightest impact can knock their ability to stand up straight or even keep a limb straight and erect completely out of whack. And don't get me started on the figures so droopy that even if you put them on stands look like they need Toy Viagra a little while later.
Glad you were able to repair him.