Hello user2018
Same thing happened with my wife. She was on H4 visa and as school offered her scholarship, she decided to change status to F1. Before the school started in Fall, we went to India in summer and her F1 visa got rejected. We immediately applied for H4 stamping again and that got approved after issuing 221b. So the time frame is like this
June 8th - F1 rejected
June 22nd - H4 stamping - got 221B
July 14th - H4 approved.
She eventually had to complete her MS without scholarship on H4 visa as my green card application was not even under process then and she couldn't get EAD. Most of the schools allow you to be a student on H4 visa but the only thing is you are not allowed RA/TA positions.