What was the traffic speed on that road? Is there a gradient? Big gaps between cars makes me think it was more than a few mph, but they don't look like they're actually moving very fast.
I'd probably have done much what you did, tbh, but that may be because sometimes I tend to prize momentum over absolute safety. The driver was dozy/selfish but not especially so by the usual standard of drivers. It looks like you identified the hazard a long way off and were prepared to take evasive action (pulling alongside him), and as he's a taxi he's probably got enough driving experience that he won't be unduly fazed by having a cyclist on his offside briefly. Some drivers would: they'd panic and slow right down