I realize I made a huge mistake in my thesis and am not sure what to do. I'm defending very soon (days away). What should I do?
The thesis and thesis defense is less about having the results you wanted to have, and more about demonstrating that you know how to do good quality research and can work on that somewhat independently. It's about figuring out what questions to ask and what methods can be used to find the answers, and then applying those methods to come up with answers. What the answers actually are is not as important [for the purposes of passing a thesis] as the process you took to get those answers. Your discovering this issue and taking prompt action to fix it shows attention to important details and integrity in the knowledge-discovery process. Sure, it would've been better if you'd caught that earlier, but you've caught it now, before your defense, and you're rewriting the discussion and conclusions to reflect your best analysis of the data.
In my opinion, your having found this and your efforts now to promptly fix it say more [positively] about what a thesis is supposed to evaluate than most completed theses.
Don't panic. Talk to your supervisor and committee. Tell them what you found. Revise your document to reflect the new understanding. Maybe you'll have to delay the defense a bit, but more likely you'll present at the same time and talk about what you found; the committee might require you to deliver a revised document [some weeks after the presentation] reflecting that before they sign off. That might take you some time to do but it should be OK, and will leave you with work you can feel is more solid.
Kudos to you for finding the issue and having the integrity to stand up for it. This should help you in the long run and the core evaluation at issue here, at the cost of some extra work to revise and maybe some scrambling to re-practice your revised presentation.
Edit: Congratulations on passing!
Get off of Stack Exchange and contact your advisor, right now. He/she is the most qualified person to help you understand what is going on and what to do about it.
It's possible you might have to delay your defense in order to fix it. That would be unfortunate, but not the end of the world.
On the other hand, if you know about a serious error and defend anyway in the hopes that your committee doesn't notice, that is deeply unethical. We are talking "kick you out of grad school", "revoke your degree years later" unethical. That is not an option. Forget about it.
It seems to me unlikely that your committee knows about the error but is intentionally ignoring it in order to "trap" you. That would be very inappropriate behavior on their part, and I've never heard of it happening. There would be nothing for them to gain by doing so. And even if this were the case, pretending you don't know about the error would only make things worse.
This happened to me. I found an error in a complicated mathematical proof in the appendix to one of my papers. As I flew home to defend it I was fixing the mistake on the plane. In the defence, I told them about the error. They told me to fix it and awarded me the degree. This was a formal political theory paper; I doubt if they even read the appendix, but I'm glad I told them.
Unless this mistake blows away your results, it's best to be honest. (Actually, it's best to be honest in any case. There are lots of bullshitter academics out there; don't be one of them.)