Sure, but you can't attribute that to unions and say that's a universal negative effect of unions, the same way that you can't say knives are universally bad because they've been used to stab people in the past.
This is an example of how it specifically is. The deal/law with the city/state/municipality/whatever is that they can't hire someone who's not associated with the union. That results in ridiculous shenanigans I just described.