True "pay to play" is where you pay no matter what the door is. This is more like...payback if you don't draw. Not entirely unfair if the terms are mutually understood & agreed to in advance.
Having said that, do you think anybody would have pulled this kind of shit on, say, Mingus?
There's a reason why some people carry guns. I myself have gotten paid on one or two gigs thanks to bandleaders who did.
Sure, that's ugly, but it's also reality. Sometimes it's play or get played.