Potty training struggles are making me resent my toddler

I feel like the worst mom ever. We tried potty training my toddler last summer and gave up after a week bc it was clear he wasn’t ready. Now, at almost 3 years old, he is ready. I know he’s ready because he’s gone full days peeing and pooping on potty. But other days? Straight up fucking refuses. He woke up from a (rare)nap today and I could tell he needed to go badly. So I did all the prompts and he lost. his. shit. Raging meltdown for a half hour bc he didn’t want to go to the potty. Then he peed in his pants for the 5th time today. I’m at my wits end. I feel like a failure. I’m getting so mad although I’m really trying hard not to show it. But it’s like, I know he knows how to do it!!! It’s so so frustrating. He starts preschool on Monday and I don’t even know what to do. He doesn’t need to be potty trained for it but I feel like we definitely cannot go back to diapers now. I also didn’t want his teachers to have to change him. So now he’s just gonna pee his pants all day at school? Idk what to do.