Estimating is hard. Developers, at least in my experience, are notorious for making their lives harder and underestimating tasks. No matter how often you tell them to be realistic, it doesn’t happen. There are a few things that can be done to mitigate this.
Be realistic about the hours actually focused on development. Many team members, especially team leads, spend a lot of time doing other tasks outside of a sprint. Make sure this is accounted for somehow.
Break things down, then break things down further. However you estimate, if part of the estimation exercise isn’t breaking things down to very manageable chunks, estimation is impossible.
Quiet planning meetings are bad. In a previous post, I said the team should just have a conversation regarding what the details of the story really are during planning. If this conversation isn’t being had, I bet someone on the team doesn’t understand it enough to estimate. Have this conversation
Lastly, don’t strive for perfection. Estimation is a dirty game that you can get good at, but mastering just isn’t worth. What matters is that things are getting done with quality in a predictable fashion. I have seen a few teams lose focus of what’s important trying to achieve better estimation. Believe me, I would much rather have a team spend an extra day making something remarkable and being a little off in their estimations.