I also have struggled with this issue for days now. I tried everything recommended in this and other threads I found but nothing prevented the "you must restart Onedrive..." warning from coming back, and the same behaviors I see others have had here.
As a last move I decided to reset Onedrive using the terminal command and "unlink this mac" then signed back in using all default settings.
This now has stopped the erratic behavior and has kept the "you must restart.." banner away.
I can now see all my files through Finder and work with them.
Unfortunately this puts my Onedrive folder (over 500GB) on my root HD for my Mac Studio M2 2023 which is annoyingly only 500GB. So I have no choice but to use the Files on Demand feature of Onedrive. Even with this turned on I expect to have problems since I work with a lot of image files and of course have other programs on this drive.
I hope Microsoft figures out how to effectively let us use external drives with Onedrive on mac Sonoma, otherwise I will also be moving to another cloud file service.
Hope this insight helps some out there.