Unfortunately, there isn't a direct way to disable the automatic disconnect for mapped OneDrive folders.
Alternatively, you can unlink your OneDrive from your computer. This won't delete any files. You can still access them online at https://www.microsoft.com/en-us/microsoft-365/onedrive/online-cloud-storage.
- Enable "Files On-Demand" in OneDrive settings. This feature keeps a placeholder for your OneDrive files and folders locally. When you access a file, it downloads on demand.