Creating a shared folder from a folder that already contains a very large number of files will often result in an error. This error only affects the creation of a shared folder and won't affect future invitations to the folder.
The simple workaround is to create and share a new empty folder in your Dropbox and then move all of the files from the existing folder into the new shared folder.
Note:
Make sure you pick a good name for the shared folder as the name of a shared folder can't be changed once it is created (you can change it locally but new and existing members will see the original name).