I did some more experimenting, and I found this:
If I exit a run on the map screen partway through, it generally saves correctly, and I can load back in upon restarting the game.
But if I exit the run by clicking "exit" (when given the choice to continue to endless mode or not), the game exits to desktop and when I load back in it's like my run never happened.
If I finish the run by dying after beating the first two bosses, the game will unlock the next-highest difficulty, but only if I start a new run immediately. If I exit the game and come back later, it will forget my previous run ever happened and only give me access to difficulty levels 0 and 1. The same will happen if I die before beating the first two bosses (fail the run).
So my workaround so far has been to quit in the middle of a run and come back to it later; then when I finish that run and unlock the next level, I immediately start a new one, get to the map screen, and save it. This does work, but it's weird and inconvenient, and I'd greatly prefer if the higher difficulties would just stay unlocked after exiting and restarting the game.