Passport expiring on h4

My question is that passport expiring in March 2017, I got stamping until 23rd March only but I have valid H4 Visa until Nov 2018. So the officer told I need to apply new passport go back to India again get stamped on new passport and she specified not to visit Canada for stamping. did anyone faced this kind of situation…please help with suggestions

Are you currently inside US or not? If you are inside US, when is your I-94 expiring?