You've got a great wee boy there, who has clearly learned good ways to manage his anxiety from you already, TotallyKerplunked. It's not easy to help anxious kids navigate what can often be a very stressful school environment and he's lucky to have you!
As for the lesson, I wouldn't just let that go either. Especially because his (presumably respectful) query and obvious confusion was framed as being rude. And I agree with asking for the lesson plan, so you know if your boy might have maybe misunderstood something before disputing the content being taught.
I would make a point of speaking to the class teacher first and clarifying what they mean. It's very possible they don't really think you can change sex and just explained it poorly.
I agree with this. My son and cousin's daughter (different schools but same local authority) had the same lesson on gender identity at roughly the same time aged about 10/11.
My DC came home quite exasperated and said you wouldn't believe the rubbish the teacher taught us today. We had a chat about tolerance and understanding (this fell by the wayside, because the teacher was so focused on the wrong body narrative and enforcing stereotypes) and about how to respectfully disagree with a teacher. (He hadn't said anything, but it was a good opportunity for that chat.)
Cousin's DC came home distraught querying if liking boy stuff really made you a boy and told her mum that if you are a girl who is really a boy you can go to the doctor who'll give you a pill which will let you grow a willy.
We (the adults) were certain that my cousin's daughter must have misunderstood the lesson, with the teacher probably explaining available medical interventions in a way she couldn't understand. So her mum explained that humans cannot change sex and that it was totally fine to like boy stuff because it wasn't really boy stuff, it was for boys and girls.
Neither of us approached the teachers at the time because it was the last month they were at primary school and we weren't that clued up about the issue back then. And my cousin's daughter clearly had misunderstood, so it was unclear what the teacher had actually said.
But I would feel confident approaching the school now.