You're partially correct as well lol. You said only in congested situations. hat's not what the highway code says. Aside from congestion, if a car is hogging any lane to your right and you're maintaining a steady speed and you happen to pass them, you've done nothing wrong.
Unless I've misunderstood some subtlety here, it's exactly what the highway code says

Highway code said:Do not overtake on the left or move to a lane on your left to overtake. In congested conditions, where adjacent lanes of traffic are moving at similar speeds, traffic in left-hand lanes may sometimes be moving faster than traffic to the right. In these conditions you may keep up with the traffic in your lane even if this means passing traffic in the lane to your right. Do not weave in and out of lanes to overtake.
It gets a bit muddy because it's a "do not" rather than a "must not", so it's not backed up by a specific law. However, on the Ask the Police site it uses your example:
AskThePolice said:However, whilst there is no specific offence of overtaking on the left, if a driver undertook another vehicle, other than in the circumstances described above e.g. in the case of someone hogging lane 2 on a motorway, they may be prosecuted for careless driving.
Note that as undertaking isn't defined as moving lanes to pass on the inside, maintaining your speed to pass a vehicle on the inside when they're lane hogging could, according to the police, get you in trouble. Of course in reality I'd assume the chances of them pulling you up on this would be minimal because i.) there would actually have to be police on the road with nothing better to do than pull you over for it, and ii.) they should really be going after the middle lane hogger instead.