Why didn’t you come to school yesterday?" implies the speaker was at school and expected the other person to be there too. It centers on the speaker’s expectation or experience.
If the speaker’s presence at school is irrelevant, “go” is more natural.
In conversation number 1 and 2, it seems that A and B are classmates, but in conversation number 3, it is unclear whether they are classmates. What do you think about this?
You’re absolutely right! In Conversations 1 and 2, the dynamic between A and B feels clear—they are classmates speaking informally about a shared environment (school). However, in Conversation 3, there’s some ambiguity in their relationship.
You don’t know who either person is in any of the conversations. But there are some hints about who they might be.
Conversation 1 implies that A has first hand knowledge that B was not at school. A knows this because A was at school and did not see B there. It only implies this.
Conversation 2 feels the most formal to me. This makes it less likely that A is a student. But other than a more formal tone, there is nothing to indicate who A is.
Conversation 3 indicates that A was not at school at the time A asked the question. There is no indication who A is other than a casual tone.
In all three cases you are reading between the lines. Without more information you have on way of knowing who A is.
All three conversations imply that B is a student. If B was a school employee like a teacher, janitor or secretary, they probably would have said ‘work’ not ‘school’.