Oh, OP, that us just awful, you must be so upset.
You and your son have been treated very badly.
As far as I am aware, it is illegal to force you to homeschool.
When your son struggled so much in primary, was an EHCP applied for or any investigation into possible neurodivergence or Special Education Needs? There really should gave been, initiated by the school. The secondary school also should have done this when he struggled there.
Once you are registered with your local authority's Elective Home School team, they offer a home visit, which is not compulsory and should be be supportive and advisory in nature. You can lawfully refuse this, and they can then request that you provide an annual report instead. There are a couple of Facebook groups where more advice and template reports can ve found.
Your local authority has a responsibility to ensure that children receive an education that is full time and age/ability appropriate, whether this is in school or at home. They should have ensured that your son was receiving this whilst he was enrolled at his schools once he was missing 14 days of school.
The official who visited was absolutely out of order and you are well within your rights to complain.
I would suggest that you write to your head if children's services at your LA, copying in your local council lead for children and education, and ask them to sort this sorry mess out.
I eoukd also be asking your housing association to get your repairs sorted ASAP, and to replace your text books etc immediately.
Can you and your son use a library to study in? There are a lot of free online resources available eg Seneca, BBC bitesize. Keep a log of what he does.
It might be worth making that GP appointment for your son to see if you can get a referral for anxiety for him.