It's called angular cheilitis and during the pandemic it was rife amongst NHS workers, I swear I thought it was permanent!! Are you wearing a mask or using anything like a mouth guard etc that might be causing it?
It can be fungal, in which case the Daktarin oral gel will get rid, it can be a B2 deficiency as has already been mentioned so a good multivitamin/B complex can help and it can be due to poor immunity which you've mentioned so just make sure you're eating ok and getting enough rest, maybe take some zinc and boost your vitamin D levels with an oral spray, it's usually those two that get overlooked when people buy a supplement but they're really important!