Ok, the error has nothing to do with firmware. It always happens on the first attempt of playing an NDS game. But if I reboot the core, then it doesn't give the error anymore, and will also begin allowing me to record a movie. Here is the error screenshot:
Full text here of the error (when opening the ROM):
https://pastebin.com/GEtyZvfw
When starting a new movie, the error is almost the same.
And yes, I'm using last devbuild: 2021-10-12-061627-#5a4e5d3ced28414dd9421b9475c912ea9b1b3a61
Edit: the error happens only if the Profile Config is set to "Casual Gaming" or "Longplays". Note that it needs to be set before opening the ROM; if you do a core reboot, the error won't happen in any case.
Edit 2: after following some instructions by feos from Discord, we found out that this isn't an issue specific of MelonDS, and it's related to running out of memory due to a rewinder buffer size setting being too big for my RAM. I'm opening an issue on Github now. Edit 3: there you go:
https://github.com/TASVideos/BizHawk/issues/2964