Restarting Pi-hole does not refresh the cache, it completely drops it.
In addition, Pi-hole's replies would be the same, regardless whether its answering from a fresh upstream reply or from its cache.
And Pi-hole's cache remembers IP addresses for domain names, i.e. it does not hold your MS Teams status information.
Pi-hole could only be involved here by blocking a domain that access to is needed in order to update or query the status.
However, if Pi-hole would do so, it would do so consistently, i.e. you would see the online status consistently failing as well.
Restarting Pi-hole would not change that.
If MS Teams would circle among different domains for status updates, then it may be possible that Pi-hole would block only one of them. Monitoring Pi-hole's Query Log would help you verify whether that's the case, and How do I determine what domain an ad is coming from? may also be helpful.
As applying chrislph's advice and changing Pi-hole's upstream to 8.8.8.8 seems to have improved your observation, that could suggest that unbound may be involved.
unbound
would refuse to resolve a domain if DNSSEC validation fails (as it should), but it would also do so consistently, until the respective domain maintainer fixed a configuration error or third-party manipulation stops.
Also, it may sometimes encounter temporary issues when resolving a domain, but usually those should be cleared just by repeating a query.
But as chrislph mentioned, MS Teams seems prone to show wrong online status information intermittently, e.g. bug - Fix Microsoft Teams showing incorrect status: change Offline to Available - Super User or Microsoft Teams Status Not Updating? 10 Fixes to Try or Your actual presence status isn't displayed in Teams - Microsoft Teams | Microsoft Learn. I notice that none of those proposed fixes mention DNS.
This would suggest that an MS Teams incorrect online status would be specific to MS Teams.