I've been in touch with the PlayStation people and their suggestions have not helped (restore licenses etc.) and directed here for advice after advice to delete more templates and worlds failed to help, even though there's plenty of space on my Minecraft profile, it just shows the same message). It won't let me download anything else now, it's like there's a glitch/bug. There's loads of storage space on my PS4 and in the Minecraft game itself but I'm just stuck. When you try again it says the same thing but where it says 'not enough space' the number of MB doubles. I recently bought currency and used it to purchase a game called Pets Collection and it's in my inventory but it won't download as it says there's not enough space on my PS4 system.
This means you can play both Minecraft: Java Edition and Minecraft Dungeons from the same place.
As of December 2020, the Minecraft Launcher supports both Microsoft and Mojang accounts. I bought Minecraft on my PS4 and have previously made in game purchases before that were fine. If not, click the arrow to the right of the Play button and select Latest Release. Please also see this comment from Mojang and you might review other comments from Mojang as well. Please do not add any comments to this report unless they clearly contain new and helpful information directly related to reproducing the problem.