I knew twins like this, diagnosed with selective mutism.
They had their own language when young, and were still using that between themselves when they started school, but were talking to family by then. Took until the middle of Y1 for them to begin to answer the register on school and talk to other children (but no adults outside close family), then their parents decided to move their school.
They came to us and reverted to total mutism outside their home. Two terms in, they began talking to one child, who would relay requests for them to other children and to staff.
Their parents said they never stopped talking at home but we literally never saw it - they did not talk to their parents while any of us were present.
However, apart from not speaking, they took full part in classroom and school life. They joined clubs, put their hand up in class, would bring their work for marking etc. I had them in gym club in Y3 - by then, one of them would nod or shake her head in answer to a yes/ no question, so I always knew which one was which (important for safety).
They were very bright, so we knew they could read because they would write in response (they wouldn't write in answer to a question, but did all their school work, so we could check understanding through that). I also checked by reading their book aloud with errors ( as I have done in the past for children unable to communicate with speech) and eventually they would point to a word I had missed or misread).
In Y6, they took starring speaking roles in the school production (both really funny, and excellent at playing the audience), and now run a very popular cafe, freely chatting to customers.
Over KS2, they began to talk more to more children, then to one TA, then answered the register, then answered a direct yes/ no question from their teacher. Painfully slow for us, but they more than got there in the end, in their own time.
The parents said they loved school, and chatted about it at home. Everything I have read says it is a form of social anxiety, but it always seemed strange that there were no other signs of anxiety at all. They were cheerful, happy, engaged, but silent children, and are now exactly the same as adults - but not silent!