This week, I had more time to experiment, and after several hours, I believe I’ve finally identified the issue.
The Kodi playback problem appears to be a symptom of a larger issue: there’s no audio output via HDMI and the audio doesn’t seem to be properly configured after install. In Kodi’s settings, it can’t detect an audio device, and under System / Audio / Audio output device, it displays “Error - no devices found.”
However, when I checked DietPi Config, I saw the sound card was set to rpi-bcm2835-hdmi. After exiting, I was prompted to reboot to apply changes, even though I hadn’t made any. After the reboot, all of a sudden everything worked perfectly, Kodi detected the audio device and played back every video without any issues.
I even tried again with a fresh install of 9.7.1 with only Kodi added. But the result was the same. The HDMI audio output is not working after the installation, but simply entering to the Audio Options of DietPi config prompts a reboot after which everything works as it should.