I started learning this game and my first runs featured a looooooot of deaths. Yet despite those deaths, my final run time was looking suspiciously average, as opposed to awful.
Based on that anecdotal evidence, plus some extra testing (loaded up a file on mission 11, stalled out a room for 10+ minutes, then died, then completed the mission) it appears that any room that you die in will not add the time spent in the room to the final in-game timer.
Not sure what implications this might have on the category rules, as it kind of allows for a pseudo-segmented approach - eg. if one room is giving you trouble, you could take an intentional death to improve its time. I don't mind this in principle, but if you do, then some ideas off the top of my head would be to either add a time penalty per continue used, or to require runs under XX:XX to be deathless. I think this would accomodate the existing runs in the leaderboard without requiring a leaderboard split.
I only have the Switch copy of the game which is probably non-ideal for speedrunning, but now that the DLC is finally available I thought I might try my hand at routing out the "best" ending.
As usual, here is a sample run. I'm not sure about the end timing - maybe it should be when the first bell chime sounds?
Sorry about mostly-invisible timer... At least it was kinda a tie with the best time so it basically counts down to the end.