The main reason for this error message is if OneDrive is restricted by your IT policies. It can happen if you have the Microsoft Intune app installed, or a OneDrive for Business account added to your OneDrive app. Corporate restrictions apply to the whole OneDrive app, so if you have both a business and a personal OneDrive account, they will both be affected by the corporate limitations.
Another possible cause for this error is a random system glitch, which is often resolved by a simple device restart. To do this, follow the steps outlined in this Apple support article: https://support.apple.com/en-us/101603