There was nothing wrong with the code in terms of structure or performance, but it was doing this really weird operation with an ID after DB insert
So there was plenty wrong with the code.
And it hasn't been fixed.
"Bro, its totally just you prompted it wrong"