https://help.minecraft.net/hc/en-us/articles/360029643892-Can-only-play-Minecraft-demo-Java-Edition- says:
If you have an older Minecraft account, try logging in with your username. You can reset your password at account.mojang.com/migrate
The highlighted text here has a broken link, it links to https://help.minecraft.net/hc/en-us/articles/account.mojang.com/migrate.
Thanks, we've now removed references to account.mojang.com/migrate on Minecraft: Java Edition Demo Mode.