The intermittent 404 error you are experiencing when accessing child folders using the Microsoft Graph API could be related to the state of the mailbox or the replication of data within the Microsoft Entra ID architecture. The error message you received indicates that the mailbox may have been moved recently, and the ExchangePrincipal object contains outdated information. This can happen due to replication delays when the mailbox is moved or updated, which may lead to temporary unavailability of the mailbox data.
In scenarios like this, it is advisable to implement a retry mechanism in your application. If you encounter a 404 error, you can wait for a brief period and then attempt the request again. This allows time for any replication processes to complete and for the mailbox information to be updated across the data centers.
Additionally, ensure that the bearer token you are using has the necessary permissions to access the mailbox and its folders, as permission issues can also lead to 404 errors.
References: