Yep it has happened not too often but it has.
Another is when a bus is taking on passengers, so I overtake only for the bus to pull out as I'm alongside and have to decide if I should accelerate and continue overtaking or brake and pull back in behind the bus.
Normally I pull back in behind and wait for the next bus stop and overtake then.