I hate it when teachers decide a) that a child needs a nickname and b) what that nickname should be. It's not their decision to make, and as a pp has said, it is usual to be asked (on forms etc) to give full name and indicate what the child is usually known as.
My dd1 is very firm with people who try to shorten her name - she only uses the full version, and will tell people directly 'that's not my name'. She used to have a family nickname (shortening of her name, but not a common one) but asked us to stop using it a few years ago.
Dd2 was always her full name, never shortened. Until one of her teachers decided to only call her by a short version, and dd2 was too shy to correct her. Now dd2 is known by that shortened version, and says 'I don't really mind' which doesn't sound like a great endorsement, tbh!
Ds is known by a shortened form of his name, and woe betide anyone who uses the full version - he has never been the full version, and probably never will be! He was quite upset when he started at school and his peg/book bag/name label all had the full version on (why, I have no idea, as I very clearly wrote the name we use on all 'child known as' forms, plus all the teachers at school know he's that version, as they've seen him since he was born, due to dd2's school runs!)
I think it's really rude to just decide you want to call someone a different name, and teachers certainly shouldn't be doing it.