What does ‘royal shaft’ mean?

( np ) A great destructive unfair act. He got the royal shaft from the principal for cutting so many classes.