I recently removed about 50% of code in a feature submitted by a colleague, because it's a pile of over-engineered mess that either never gets used or caused trouble for us. We probably would not have added the code in the first place if we actually discussed the design. With the code removed, the feature is now much simpler and more maintenable.
And that's the second time this happened over the past few months.
One time before LLMs we outsourced this project. It was something to sign file headers, written in ruby by an overseas company. It was something like 4500 lines long, and I wound up reducing it to something like 550 lines.
My story, like yours, has nothing to do with the topic at hand.
It happened many times to me, as well. Humans write terrible code.
You didn't even mention if the code you're talking about was generated or not.
And that's the second time this happened over the past few months.