Your lawyer examined the document and said it is a valid legal contract. You should follow the advise of your lawyer. Ask questions about your situation and have your lawyer explain the details so that you understand all your options. I have said to other posters that "It doesn't make sense for a lawyer hearing a few isolated facts over the Internet to second-guess the lawyer representing you."
Good luck and God bless you.
In the State of Illinois, I move the court to stay the order of possession (the banks right to enter the property) pursuant to the Statute you referenced. There has been very little interpretation of the statute, so I would ask the court for the term of the lease and hope you get that or some other additional timeline. Whether this mechanism works in California, I do not know. However, if orders of possession are issued in California foreclosure cases, then I would say that a Motion to Stay the order of possession is your best bet.
I agree with Mr. Brinkmeier but would also suggest that you consider what is most beneficial to you. Yes, you may have a valid legal contract which would provide you an opportunity to stay in the premises until the termination date of the lease. Is the termination of the lease a date further into the future than the 90 day notice you would otherwise be entitled to under the Protecting Tenats At Foreclosure Act? Just an additional thought to consider. . . .
The response given is not intended to create, nor does it create an ongoing duty to respond to questions. The response does not form an attorney-client relationship, nor is it intended to be anything other than the educated opinion of the author. It should not be relied upon as legal advice. The response given is based upon the limited facts provided by the person asking the question. To the extent additional or different facts exist, the response might possibly change.