Your school were wrong, and you were absolutely right to check!
I see no reason why you shouldn't be able to resit it in June 2024, alongside your A levels. Talk to your school about your options. (If they can't help, you might have to retake it independently - still in June 2024).
Which exam board are you and your school using for IGCSE Maths?