Not the person you asked but I have definitely done that. Usually writing overcomplicated code means you don't understand that particular domain/tech well enough and there may be no one else around to ask.
Half way in you realize you took the wrong approach. Now you have the difficult decision of sunk cost a fallacy here or not.
The correct answer may not be obvious, sunk cost isn't always a fallacy. I have definitely made wrong decisions here in the past and wrote bad code.
But sometimes the decision is ship something or nothing?
We weren't building some little website. This was actual people's money on the line.
It's specifically why they hired me, since I have a history of writing secure fintech software.
But they royally fucked me over, abused me, and burnt me out. So I left.
Be honest - did you write an overcomplicated piece of code that was super hard to understand? Because I know really good programmers that overcomplicate stuff and it takes a team to unwind their work. I respect these people, mind you.