It seems like you are already analyzing the mistakes you made and will adjust in the future accordingly, so you’re already many steps ahead of many of the less successful engineers I’ve worked with. Many of them will just blame everyone and everything else for poor outcomes rather than accepting responsibility and trying to improve in the future.
My main advice: always under-promise and over-deliver. Managers don’t see code typically, they usually are more focused on deadlines. Be very pessimistic when discussing deadlines. Take your initial estimate and double it to account for potential problems. Be very clear about risks beforehand. And lastly, no one cares if you wrote some chunk of code or if someone under you did, all they care about is knowing who lead the team that delivered it on time. Be that person and you will be successful at almost any company.
My main advice: always under-promise and over-deliver. Managers don’t see code typically, they usually are more focused on deadlines. Be very pessimistic when discussing deadlines. Take your initial estimate and double it to account for potential problems. Be very clear about risks beforehand. And lastly, no one cares if you wrote some chunk of code or if someone under you did, all they care about is knowing who lead the team that delivered it on time. Be that person and you will be successful at almost any company.