A “nerdy” science buff claimed to have caused an explosion while carrying out experiments in his shed, then blamed a life-threatening allergic reaction on his mother’s potpourri, a court has heard.