https://internationalcenter.umich.edu/fsis/travel-while-h1b-petition-pending
“You must not travel outside of the U.S. while the petition is pending. Leaving the country while USCIS is reviewing your petition will cause USCIS to consider your petition for a change of status to be abandoned. Your underlying H-1B petition may still be approved, but you would have to depart the U.S. and apply for an H-1B visa abroad to re-enter the U.S. in H-1B status before you could start your H-1B employment.”