What version of QuickTimePlayer are you using? On my Mac, running Mojave and iMovie 10.1.12, QuickTimePlayer version 10.5 plays all Mp4 movies exported by iMovie.
Try deleting preferences and then exporting again. Deleting preferences is a safe procedure that will not cause data loss or disruption to your project. To delete preferences, open iMovie while holding down the Option and Command keys and select to delete preferences in the box that appears. iMovie will open in a new library. Reopen your old library to get back to your projects. Share out your project again and see if the exported movie will play in QT.
If still no luck getting the exported movie to play in QT try doing an Edit/Select All, Edit/Copy, of the media in your project and pasting it into a newly created project. Then share out the movie and see if QuickTimePlayer will play it.
Failing that, try converting your troublesome video to H.264, Mp4/AAC with the free download, Handbrake. Do that even if the codec already is indicated to be Mp4/AAC. Re-rendering often cures issues.
You can get Handbrake here:
https://handbrake.fr/
A simple way to do it is to open Handbrake and do a File/Open Source. Navigate to your video and choose it as the source from the resulting screen. Then do File/Start Encoding. Wait a couple of minutes for the conversion to complete. Then save and import the converted clip into iMovie.
-- Rich