Yep exactly, LLMs blunder over the most simple nonsense and just leaves a mess in their wake. This isn't a mistake you could make if you actually understood what the library is doing / is returning.
It's so funny how these AI bros make excuse after excuse for glaring issues rather than just accept AI doesn't actually understand what it's doing (not even considering it's faster to just write good quality code on the first try).