Api error 400 on image generation with gpt-image-1-2025-04-23 but still paying the cost of generation

Hello,
I sometimes get the 400 or even sometimes the request takes too long and timeout and i still see in my usage console that I’m paying for those failed request. Is it normal ?
I’m pretty newbie so I would love some guidance on this.
Thanks