Hello, Welcome to Microsoft Q&A,
This is a known issue. You can try the workaround in Hololens: Failed to export the spatial mapping database and system map - Microsoft Q&A.
Restart Device Portal permissions in hololens [Setting > Update & Security > For developers].
For sharing Anchor, you should use Export System Map & Anchors, please refer to Using the Windows Device Portal - Mixed Reality | Microsoft Learn.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.