Hah they sent you back to check in desk from the gate while boarding?? For "heavier bag than recommended", and you went?
That's crazy. Probably they were expecting to run out of overhead bin space.
1. You could have given them the bag and say ok, check it in, take care of it. They usually do that when they pull moves like this on the gate.
(Next options are only if you have few kilos over and are not trying to bring a 20kg+ suitcase that belongs to be checked in, that's totally on you)
2. I would've said that ok I'll just throw some stuff out and stuffed my pockets and put jacket on stuffed them full and then loaded back while on the way to the plane. Or carry your books for a minute or whatever.
3. if neither would've worked out I've would have escalated right there on the spot and make sure that whatever they are trying it's going to cost them and the airport time and money. Threaten with disputing the cc payment, pull out your smartphone and start recording audio and take employee names and id's. Don't buckle if they want to get security involved. They most likely will just let you go in with the bag and bother someone else who is more gullible.
4. The worst option is you start going back and miss your flight. And they will do this again and again to other people. Airlines and the staff are not public service transportation, they are money making operations and it's very easy to get abused by their bureaucracy.
A lot of the EU laws are good at giving the consumer some protection form them and filing for settlement if they pull bullsh*t (like f*cking up what makes them delayed (over 3 hours) and so on.)
But that is all spilled milk under the bridge. But, just info for the next time and for someone else caught in similar situations.
Hope you enjoy the rest of your time in Dubai and have a good journey to next destination!