I went through getting off heavy weed use over a decade ago. I'm not anti weed (of course) and would sometimes use it side then if offered and in the right setting/circumstances. These days though I generally avoid it.
First thing I would say is find a GP who actually cares about their patients if the symptoms persist. The way my GP explained it is that using heavily it prevents seratonin uptake in your brain, since it doesn't need to utilize what your body produces it and gets lazy.
This is fine while you're using, but the pathways 'dry up', so when you stop using you don't immediately get the seratonin uptake back. Seratonin is important for sleep cycle regulation, mood, etc. Pretty important all round.
It can take years to get back to 'normal'. My GP gave me a drug to help with that and it seemed to work (don't know what it was unfortunately). But a healthy diet and sunshine/exercise etc will help. I think melatonin is used for seratonin production.
So yeah, give it time. Don't be afraid to use it again occasionally if you have the discipline to not get habitual again, but ultimately it's one of the downsides we don't get told about kek. There are much worse things out there imo.