Critical thinking is a learned skill. For most developers it comes with experience, and many developers in startups are often yet to learn it. Thinking well under pressure is even harder.
This is more a problem about startups using inexperienced developers than anything related to what they're building or which tech they're using.
It comes with experience, but also with more senior devs explaining it to you.
Seing someone use firebase to save paiements, then recompute a total from a collection, and as a consequence having its system explodes with less than one session per second, means everybody in the team drank the « let’s use this nosql google shiny tech, it’s so cool » cool aid.
Even one conversation with any senior dev having some kind of experience with backend development would have asked about expected load, types of queries, data model, etc. And concluded that storing paiements was probably the least interesting scenario for using a tech like firebase.
This is more a problem about startups using inexperienced developers than anything related to what they're building or which tech they're using.