Per my test, I found there is one step missing something in the link you shared. Please check if you have entered App's Permission Request XML and trust it correctly in https://xxx.sharepoint.com/sites/xxx/_layouts/15/appinv.aspx. It should be like following
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
</AppPermissionRequests>
Then trust it after click create
Finally I created the folder successfully by the steps in the link
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.