I actually don't remember what I did when encountered with this problem. I think I looked at my battery connections (which I think were fine) and it never happened again. Check this thread, it had more replies:
https://www.rx8club.com/rx-8-discussion-3/weirdest-shit-just-happened-201930/