As a person completely unqualified to diagnose anything but with similar problems, I suspect the real root of your issue might just be the anxiety. If you could address the roots of that, caffeine would probably become irrelevant.
ADHD travels with friends and anxiety definitely tends to be one of them! When you get a proper diagnosis they try to rule out if it's not simply just anxiety, and or something like obstructive sleep apnea. Both of these can have ADHD-like symptoms. Luckily for me I have all three of these things, so it's been fun teasing apart what's what, but that's why a formal diagnosis is an important process.