Developers are not entirely at fault for getting trapped in these kinds of situations. Sometimes it is extremely hard to say no to a short deadline.
I often feel like dev teams are bullied into giving short estimations by other departments and that forces them to cut back on any buffers that could account for time lost to mistakes and unexpected changes in general.
The truth, however, is that your free time is not a buffer, and it should never be.
Having said so, yes, there are situations when the work needs to get done during the weekend or evenings but that should be an exceptional situation and not the norm. It’s better to give a high estimation, even if it might ruffle some feathers instead of constantly having to catch up.
By promising to work weekends (even when you succeed), you still lose some of your credibility. It ultimately sends a bad message; one that says that the task’ completion times are being underestimated.
Furthermore, a lack of credibility hurts you and your team. It will eventually evolve into a lack of trust, and as we all know, this is something very hard to rebuild.
If you are a junior/mid developer you might feel the pressure to work fast, but it’s better to learn how to manage your work and expectations to avoid using your free time than dealing with the long-term consequences of not doing so.
Deadline estimations should include some buffer time because shit will hit the fan — that’s life. Even when planning thoroughly and including buffers, you might end up running behind schedule.
Instead of committing to work over the weekend, just request extra time. Then if you really want to, you could still use your free time but you should never use it as a default option as others might take it for granted.
In situations like this, I like to remember that time is the most valuable thing you can give to other people and it should be treated accordingly.