Have you heard of POTS? I wonder if electrolyte imbalance was/is driving some of your symptoms. Doing low-ish carb (nowhere near keto) and IF 18 hours a day, I have to supplement electrolytes or else I have very similar symptoms to you. YMMV of course.
Yes, that was considered as a possibility, and it still could be. But as the name suggests (postural orthostatic tachycardia syndrome), there should be orthostatic tachycardia which I don't have. I just get (as far as I can tell) random episodes of sinus tachycardia + lightheadedness, which have happened while being seated. I got an echo and many EKGs that were all normal. I can't seem to connect the dots on any triggers or things that help. Been trying to exercise more which does seem to help, but exercise probably helps everything.