The best way to pull this off is that both the magical answer and mundane answer are plausible because the answer of "is it magic or scientifically explainable* doesn't matter as the result would be the same.
Consider the Climax of the Harry Potter series, where Harry is outwardly believed to be dead, meets the firmly established dead Dumbledoore, who gives him helpful advice, and is permitted to to magically return to health from his current state (magically in context of the series, where the rule on resurrecting the dead with magic is understood to be that it cannot be done.). At the conclusion of this, Harry asks if this meeting and environment are "real or just a dream". Dumbledoore responds by asking Harry, "If it is all just a dream, does that make it any less real?" and sends Harry back to the waking world.
In the context of the story, Harry enters and leaves with no physical evidence of his experience but knowledge that he can use to accomplish his goals. Thus, the reader can make the argument that Harry did die and did resurrect due to some unknown factor, that if duplicated would permit the same thing to happen again (Magic, by the setting's rules) OR Harry did not die but had a dream where he was able to recall a subconscious thought that his brain presented in a highly detailed world of the aferlife (science, by the setting).
Both explinations can account for the dream but neither is supported by the evidence supported, and Harry's phrasing of the question is a logical OR statement. Either it is a (Real AND the Afterlife) OR (Real AND Dream). In both cases, the event Harry perceives is a reality he experiences and thus meets the definition of real. Thus, the logical question properly reduced is Real AND (Afterlife OR Dream). What Harry asks is, in logic, REAL OR DREAM. Logically, a dream is a real event that can be experienced so thus, whether or not it is a dream would have no bearing on the case as if it is a Dream, it is a real event and if it is a trip into the afterlife, it is a real event. Logically, Dumbledoore's answer (a fancy type of the Mathmatician's yes, or a simple yes response to a Logical OR statement in which the two conditions can be true at the same time. It's neither a false dream or a false afterlife.
But furthermore, this question does not matter to it's place in the logical order of events in the waking world when Harry returns. Harry was put into an unresponsive state that was death like in nature and woke up and with information that allowed him to win the fight. Harry's perception of this and whether it is logically consistent with established story rule science or magically breaking these rules does not matter objectively. Ron Wesley and Hermoinie Granger both witnessed the same thing and given the same story and evidence of the event by Harry. Ron can say it was magical while Hermione can say it was plausible as we have no evidence what happened was new magic or mundane dreaming. All we can say is that Harry experienced a real event that allowed him to tangibly alter the outcome of subsequent events.
Thus, the twist can work if the universe's logic is consistent and your extraordinary event offers no evidence to back the claim that the understood logic is not complete OR the understood logic was followed perfectly. If you see a bright light in the night sky that suddenly disappears, is that enough evidence to suggest an alien spaceship with a clocking devise or the burning of distant swamp gas? It could be magical or mundane, but it left no evidence either way is correct. It is none the less an extraordinary event with an ordinary explanation. The quibble is over whether the rules of the science are fully understood.
To Paraphrase a Dan Brown Novel, "It is often incorrectly thought that God and Science are at odds, when in fact, they are not. Science is merely too Young." The idea is that if there is a fantastic entity that created all things, and the rules there-in, than by better understanding of those rules does not mean that the entity does not imply that the entity exists, but that the rules of creation are not fully understood. As an author, you set the rules of the story, making you God to it's characters. They could grasp the rules, but they may not understand them all. You on the other hand, know the complete rule set. So long as the exception is consistent after it's discovery, it is still a valid rule in the set.