Wasted a year to port some software over to a new embedded platform but eventually it became a new OS (GOS - named after me obviously) , network stack (RS485 based) with queues , new debugger but it was all so buggy that is crashed more than it ran.
I was so overwhelmed as I kept working on new stuff without fixing existing stuff that eventually a veteran saw me struggling and took me aside and helped me to do a quick and dirty port minus all the crud.
I learned a valuable lesson - yes write good code - but good enough - and know when to STOP and SHIP it.