When you file H1B for the 1st time (not extension), there are two things -
1. Your H1-B petition, and
2. Change of Status OR Going back to consular processing for VISA stamping and enter USA in H1B
Most people choose change of status.
You file both together.
In your case, Your H1b petition was approved but change of status was denied. Now you have to go back and come with a VISA stamping. Also your H1B only starts from October 1st.
It looks like there is some confusion in the dates here.
There is something called CAP-GAP rule, which allows expiring OPT to continue to work while H1B is still pending.
Your student VISA is out of picture in this scenario. VISA is only to enter USA, your F1 is your status and Valid I-20 is all you need to maintain status.
Let me ask you this - When you received your "application received-receipt" from USCIS, was your OPT still valid?
Also, If it was valid and then expired during your H1B application pending, Did you call your school to extend your OPT I-20?.
It simply seems that your OPT I-20 expired before they received H1B application or the valid I-20 was not submitted with application.
hope this helps....