Maybe I am simplifying this too much…but when I did design work there was a contractual pay structure in place. So I was going to get a certain portion up front, then the bulk in the middle, and the final amount at the end (usually a 25%/50%/25% arrangement).
That way if they refused to pay at the end, I had gotten paid for my time if not for the product.
Not sure why they didn’t have something in their service contract too.