Hi,
Error 50 is a rendering error. Looks like there may be some issue with the audio in your media. iMovie likes Mp4/AAC. AAC stands for Advanced Audio Coding.
First, make sure that your camera is supported by iMovie.
https://support.apple.com/en-us/HT204202
The next thing I would try is opening iMovie while holding down the Option and Command keys, and selecting to delete preferences in the box that appears. Sometimes that cures glitches.
If that doesn't work, see if the issue might be confined to just this one project. Do an Edit/Select All, Edit/Copy, of the project media in timeline view, and Edit/Paste it into a newly created project. Then see if you can share out.
There might be an audio issue with one of the clips in your project, in which case you will need to track it down by a process of elimination -- duplicating your project and then removing one audio clip at a time as you share out until you get a good share out.
If the audio in your clips is in some format that is incompatible with iMovie, you can do a test by dragging one of the clips to your desktop and using the free download, Handbrake, to convert or reconvert the clip to Mp4/AAC. Put the converted clip into a newly created project and see if it will share out.
-- Rich