Hi @Burhan ,
As per me test, I could also reproduce this scenario in my end. I couldn't add shortcut of a folder inside a library to OneDrive if you have synced the library to OneDrive and the same error like yours appeared. This is a default situation in OneDrive and there is no solution to it.
Once we can disable "add shortcut to OneDrive" feature using the PowerShell command: Set-SPOTenant -DisableAddShortcutsToOneDrive $true
. However this command has been banned by Microsoft not long ago. So there is no way to disable that feature currently. You can vote up this user voice and share your idea under the post here: Disable "Add Shortcut to OneDrive" for a Document Library to let Microsoft know your requirement. It is a place for customers provide feedback about Microsoft SharePoint products. What's more, if a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.
If an Answer 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.