The official OneDrive client for macos has been made, after the release of Monterey, compliant with the cloud APIs of the OS which arbitrarily determine whether a file is kept local or if it gets offloaded and must be fetched from the cloud. There is little fix to that. You can mark files as available offline, but an algorithm you have no control over has the final say on where that file resides.
So instead, since I have a NAS, or Network Attached Server, which also supports OneDrive and other cloud services, I have configured my OD on it and mounted its file share as a network drive on my Mac. Because it is not on the Mac, the files remain all locally downloaded. Not an inexpensive practice and updating files on the cloud may be slower, but it gives me the local copy i can no longer have on my Mac.