High school vs Middle school world qualification invitations

I’m from Michigan. This year at states, there was a separate tournament for middle school and High school. However, middle school teams did also compete with the High school teams. A middle school team actually made it to the finals in the High school division. I’m wondering if they qualify and compete in a middle school tournament at worlds or if they get a high school spot.

Also, the way the extra spots are given out for people that qualified more than once for worlds went to skills. Many of the top ranking teams in programming and driver skills were middle school teams. Do middle school teams get to qualify based on how they do compared to middle school teams and vice versa? If a high school team were to be picked, would it skip over the middle school teams?

I’m curious because we’re second in the state for Robot skills for High school and fourth over all(there were two middle school teams above us). There are 3 extra spots because there was three overlaps for awards that qualify for the world championship.