It appears simply from the information given that you need to depart the United States before the expiration of your I-94; otherwise, you will be out of status. Your visa will still be good, and you should be able to return to the U.S. You do not have to return to your home country. You simply need to leave the United States and provide the airline or the border-crossing guard your unexpired I-94. You will be issued a new I-94 upon your return and maybe the immigration officer will give you a longer status period if you ask for it.
Alternatively, you can apply for an extension of status, the form for which can be found on USCIS's website. However, you need to have compelling reasons for your need to remain in the U.S. beyond the expiration of your I-94.
I would want to see your passport and your H1-B documentation to see if all of these items are valid. If you have valid documentation, and a passport that expires at least six months beyond your intended period of stay, then this could be a CPB error at the port of entry.
If this is the case, you would need to return to the Office of Deferred Inspection at your port of entry to have the problem corrected. Any questions, feel free to contact me.