Chapter 7 bankruptcy may still be an option for you even if you do not pass the means test. If you have primarily business debt or other non-consumer debt or certain active duty military are exempt from the means test as we know. But even if you are subject to the means test that does not mean that your case will be dismissed if you do not pass.
The United States Trustee, who oversees bankruptcy filings and makes sure no one who is not entitled to it receives a Chapter 7 discharge, will sometimes decline to file a motion to dismiss if they think it is appropriate. Common reasons for declination are significantly reduced income, severe medical conditions, or other compelling reasons. Someone who just lost their job will not have the same level of income in the furture.
Additionally, Section 707(b) of the Bankruptcy Code makes dismissals discretionary for the judge. The judge is not required to dismiss the Chapter 7 even if the presumption of abuse is not rebutted. You may be able to persuade the judge if there are good reasons.
