TBF if it's a random U turn done without proper checks then the situation was probably assessed as safe to overtake, maybe even with the proper precautions such as staying out wide. It's easy to say if wasn't safe to overtake with hindsight but if the guy just pulled out then it's his fault, he should check mirrors and blind spot, then signal, then check again before doing the manoeuvre.
TBF if it's a random U turn done without proper checks then the situation was probably assessed as safe to overtake, maybe even with the proper precautions such as staying out wide. It's easy to say if wasn't safe to overtake with hindsight but if the guy just pulled out then it's his fault, he should check mirrors and blind spot, then signal, then check again before doing the manoeuvre.