In the UK, red means DO NOT CROSS the line of the traffic light. If you're already past the line by the time it goes red, you're on your own (e.g. traffic jam in front but no yellow box forcing you to keep the junction clear and nothing moves for a whole phase) but it's not an offence.
The problem is the latter. The cameras check if you are in the intersection on red, so if you cross on yellow, and don't get out (easy if the yellow is too short).
Btw, you are not supposed to enter the intersection unless you can pass all the way through, if you end up being stuck due to a traffic jam you are also breaking the law.