The questions is:
Did you get your receipt from USCIS before your OPT expired when you filed your petition for the first H1B ? If yes, then you are OK. Your status was H1B pending before you got approved. If no, probably you need to consult your lawyer to see if there is a problem or not.