US doesn't have exit controls on their borders, so it's not a problem leaving the US even if you're out of status in America.
The best course of action for most folks in such a scenario is to file a I-539 change of status before their status expires to transition from H1-B into B1/B2 visitor status.
Another potential issue is if you transit through a third ...
Under ordinary circumstances, any traveler under 20 years of age needs to get the OCI card re-issued every time the passport is renewed. Source (emphasis mine)
(a) OCI card is a smart card;
(b) Possession of an OCI card will facilitate quicker immigration
clearance at the Immigration Check Posts;
(c) It will help in obtaining various Consular Services from ...