Just talk to your manager and see what can be done. It's likely they just grabbed someone to fill a shift and didn't really think about it. My old manager used to do that a lot. If the manager doesn't care, and keeps giving you shifts like this, find a new job.
As far legality, the only legal issue I'm aware of is if you're a minor (I'm pretty sure you're not) you can't work past a certain hour