The only time I ever worked on a multi month project where I didn’t do that I didn’t end up getting paid.
The engineering retainer times out monthly and gets refreshed before the next month, or when it's exhausted, whichever comes first. Done properly you're not one of your client's creditors: The client should always be in a financial position w/r/t you where you're pre-paid, your compensation secured by the positive retainer balance and if you really get serious, by retaining a perfeted security interest in the work product.
So far, it hasn't been a good idea to start out that way, even from our perspective. The problem with "projects" is that there are usually requirements on both sides, and payment + delivery keep things urgent for both sides. I hate projects that go on forever because the client can't produce things they need to or respond in a definitive manner. Holding the deliverable back is a pretty impactful negative consequence (or: motivation).
We are exploring an "agency of record" start-up engagement where the retainer plus phases may be the way to go. But it's less of a project with deliverables than agency-of-record time and effort.
Unless you're working in a physical office, or on a platform that handles escrow or similar, of course.
Just don't do it. You will lose literally zero good, profitable opportunities by following this rule.
OK so maybe the only other exception to this rule is when you have a real life serious executed contract and a purchase order with a serious company with hundreds of employees at minimum. Actually just kidding even then don't do it unless you know what you're doing. Those guys decide not to pay or pay months or years later a lot of the time too and will put you right out of business.
If someone complains about your policy tell them that you don't have a business manager, billing department, or collections operation, and by not having that you're passing all the savings on those functions on to the client, in exchange for a simple deposit or retainer.
Trust me on this. I'm old and have seen a lot of shit. Until you have a ton of experience freelancing or consulting or running an agency and don't need to ask questions like this just start off by getting a deposit or retainer up front every single time you do any work at all.
On the whole this is how the world operates. Work then pay.
"Everybody wants me to fail." (No, we are all putting overtime because of your bad decisions, but it turns out they were REALLY bad)
"The client was really happy with our demo" (Except for the part where it crashed for half a day and they are threatening legal action)
"I made the software work!" (No, you fixed one minor module because the guy you did not pay slammed the door)
"Can we just changes this?And this?And then bombards you with 20 back and forth of last minute changes that have never came up in previous 10 meetings you had" (Either can't make up their minds or simply no idea what they want or just delaying payments).
Since then, I have a rule, that only failed me once: before working a month for a person, work a week or less, get paid.
There are smart scammers who are really devious but those I have met had all kind of pathological problems they were in denial with. I think that most scammers live in a fantasy world.
By forcing them to prove they have money, are ready to pay you and know how to make a bank transfer, you are pruning a lot of them.
Also, and especially in my case where I have several international clients, the "I dont understand the bank transfer got refused" excuse is very common (and sadly, very believable). Having worked through all the troubles of making a payment from their accounts to yours already sets expectations about normal delays.