Hi and welcome,
I'm assuming you didn't relapse and this was a temporary situation with recovery some hours later - What you might have experienced is cognitive dysfunction (cog-fog) in it's 'extreme', your not alone in experiencing this, at least 50% of pwMS experience cognitive issues and there are a few commonly known situations that make cog fog much worse than your everyday cognitive norms eg weather temperature ie heat intolerance, sleep deprivation, depression, medications, physical and mental fatigue, stressful situations etc
I would highly recommend you contact your neuro and arrange for cognitive testing with the view of better understanding of your specific cognitive issues and arrange to start cognitive rehabilitation, with the addition of learning which tips and tricks and preventative measures will help with your specific cognitive situation. Below is a good article on the different types of cognitive issues common to MS...
https://www.mstrust.org.uk/life-ms/wellbeing/thinking-and-memory-problems
I hope this helps.....JJ