In worst case senario, it can be very serious and subject to 3 years bar. and no way out if you only can go with EB based categories.
You will need to try your luck based on CBP and USCIS remiss. Maybe CBP will let you reenter in H1B, and maybe USCIS will only check your status since your future reentry during the AOS examination. It is possible. Worst case 1: CBP refuses your admission and ban your for the 3 years bar. Worst case 2: CBP let you back by mistake, but USCIS during your AOS examination find out and enforce this mandate.
You will need to try your luck based on CBP and USCIS remiss. Maybe CBP will let you reenter in H1B, and maybe USCIS will only check your status since your future reentry during the AOS examination. It is possible. Worst case 1: CBP refuses your admission and ban your for the 3 years bar. Worst case 2: CBP let you back by mistake, but USCIS during your AOS examination find out and enforce this mandate.