It seems like ffmpeg doesn’t like the MKV as input, had the same VFR issue when remuxing to MP4. I had to extract the videostream from the source MKV first with mkvtoolnix and gMKVExtractGui:
https://www.videohelp.com/software/MKVToolNix
https://www.videohelp.com/software/gMKVExtractGUI
Open gMKVExtractGUI, set the mkvtoolnix path, select the video stream and hit extract, which gives you a file called “LOTR FOTR HDR 23_98fps_track1_[eng].hevc”
You can then use MP4Box (part of GPAC Tools: https://www.videohelp.com/software/MP4Box ) with this command to remux the HEVC file into a new MP4 container, keeping the constant 23.976fps:
MP4Box -add "LOTR FOTR HDR 23_98fps_track1_[eng].hevc" -new "LOTR FOTR HDR 23_98fps.mp4"
ffmpeg also worked after extracting the videostream (with warnings though):
ffmpeg -i "LOTR FOTR HDR 23_98fps_track1_[eng].hevc" -c copy "LOTR FOTR HDR 23_98fps.mp4"