Unless you're in a tiny company that will literally go out of business if the project isn't complete, there is a valid middle ground: cover your ass to avoid blame, pitch to the PM to get the schedule extended, salvage as much as you can, and move on and do better next time.
In the meantime, take a better job if one turns up. But don't be lured into extreme action by magical thinking. If a failed project is inextricably linked to your personal well-being, you're in the wrong business.