Some YouTube mp4 files have codecs that are not compatible with QuickTime Player. QuickTime Player likes to see H.264 AVC/H.265 HEVC video and AAC audio. YouTube likes to use VP9 video or AV1 video and Opus audio, among other codecs, but it can differ by video. Other partial combinations are also possible.
You can either convert your downloaded file to something that is compatible, or filter for compatible codecs when downloading (the latter might not always result in maximum resolution). You can only choose from what codecs YouTube decided to make available. It can differ by video, and can differ by time. Older uploads may be encoded according to the policy (preferred codecs) at that time. Legacy videos may be available with reduced options and reduced quality (presumably to save server space).
What tool did you use to download?
yt-dlp "https://www.youtube.com/watch?v=lkbP5OPQhdQ"
(no options specified) would get the default (“best”) version, regardless of codecs or container file. May result in .mp4 or .webm or .mkv, depending on what codecs were automatically chosen. If .mp4, that variant may or may not be compatible with QuickTime Player, depending on what codecs were automatically chosen.
yt-dlp -F "https://www.youtube.com/watch?v=pDyl6I6ESSw"
(capital F) lists available formats for a given YouTube video. You can only choose from what codecs YouTube decided to make available for a given video.
yt-dlp -f 137+140 "https://www.youtube.com/watch?v=wp43OdtAAkM"
(lower case f) format 137 (example) indicates H.264 AVC 1080p video, medium frame rate
(lower case f) format 140 (example) indicates AAC LC audio, stereo, ~128 kbps
This would be muxed into an .mp4 file that QuickTime Player can read.
User notes on YouTube format identifier numbers - Github Notes
yt-dlp -h
Usage help text for yt-dlp command line tool. Lists all the other tool options too, if you want to dive deeper.
Terminal user guide for Mac - Apple Support