In other questions I have already read that the windows 10 edition was once available free of charge in addition to the Java edition () and had it installed once (this way free with the code), but since I flattened my pc, and it has been installed again wanted to install (free of charge via the code on the mojang website) it no longer works because I can no longer find the code at all. So is it now true that Mojang no longer gives out codes and that I would have to buy them even though I already had them?
That's true. The campaign ended at the end of 2018.
There are no longer any free codes for Minecraft Windows 10 Edition.
You have to buy it now.
All codes were removed from all Mojang profiles in April 2020. If you already had it, you can download it from the Microsoft Store.
Okay thank you very much