You apply some good game design logic in your example, but I'm afraid it might not help the issue at hand. Reading about a fictional castle level and some design decisions will hardly increase one's pool of ideas for a given level.
Also some nitpicks:
- If you exploit a theme in all ways you can think of in every level you make, all your levels of a given theme will be very similar. Restraining yourself to keep the level focused beyond a theme is important as well
- "the most logical way to transition between two sections is a door" - not generally a rule
- "We can put a warning for the player like a Toad or a sign telling us that the lava will rise" - it's generally more elegant to introduce things without interrupting the flow of gameplay
- "This one must be a little more "classic" but with a little more present element like Thwomps." - also not a rule.
- "You can also put a checkpoint at the beginning of this section, so the player will not have to go back to the section where the lava rises and he will have the feeling to have accomplished something. " - note on checkpoints: if at any point a segment between checkpoints in your level feels like it's just a bit too long, it is probably a good idea to add an extra checkpoint. the more levels you make, the more you get a feeling for it, but also make sure other people play your levels to give feedback.
- "you reach the boss" - bosses are also not a hard and fast rule, even in castles. putting a boom boom is also hardly level design advice, as the fun part is crafting the arena he is fought in
- "If you want to make it pleasant, I advise you to create alternative passages (like one up and one down). The player should be able to move freely from one to the other, so that he can explore both and not miss anything." - a style of level that is pretty difficult to pull off. back in the day it used to be popular, but it caused players to explore BOTH paths and just roam an empty section after backtracking. i wouldn't say this equates to "pleasant" for the designer or the player
- "Enemies must be distributed in a fluid way; there must be enough of them to create a challenge but not too many to overload the level and discourage the player" - this is generally good advice, but does not apply to all styles of level design, and it feels like a weird thing to point out specifically in the context of breaking a section into two layers of elevation, as something more important for that style is that you dont accidentally ambush players on the other route (unless you specifically want to!)
- "To avoid boredom, you can put coins in the empty areas so that the player can find interest in exploring them" - players are more interested in interesting obstacles than trails of shinies. so far this description has not revealed much about how to craft such obstacles. it is also a lot more difficult in the type of section you describe than in a linear section.
- "In addition to coins, ? blocks and bricks can be put in places that are a bit "flat". The player will be curious to know what's inside the blocks and you can also put them on top of each other for a little platforming" - not a rule either. many players might also just be jaded and tired of having to bonk 5 blocks to know where the powerup is, and when there is no powerup they get frustrated. generally speaking, on a 2nd run through a level, only ?-blocks with valuable rewards are hit, so i often dont bother placing any at all. there are more fun activities for players to do
- "At regular intervals, you have to put a power-up." - technically also not a hard and fast rule. plenty of smbx levels and videogames in general do fairly well with only 1 hp on the player. different design style again
- "And as for the dragon coins, they have to be placed in places that are quite difficult to access" - remember that 5 dragon coins are worth 1 up. 1 dragon coin is roughly equal to 20 coins. it's not that big a deal. place however many dragon coins you want in whatever location you want imo. same for secrets: they dont have to be hidden or hard to find. they can just be funny or interesting ideas.
CAPEYOSHISMBX, if you want to learn more game design principles, check out the threads I linked. It's an entire field of study and impossible to compress into a single forum post. Watch the youtube videos, read the threads, and if something stands out to you as something that might be fun to try, try it!
Billy's advice of taking inspiration from others is also very valid. Creativity is just taking ideas and reshaping them. Many people in this community take ideas from Mario games, Sonic games, Kirby, Zelda, Metroid, Owlboy, Celeste, Hollow Knight, or whatever other things they like! Knowing how to turn them into level segments of your own takes time and practice. You get better at it with each level you make, because you learn more about what SMBX2 is and is not capable of.
Regarding level length: Don't feel pressured to make long levels. When I make levels, I base their length entirely on how many ideas I have for the level. If I run out of ideas, I try to end it as soon as possible. Making longer levels to step out of your comfort zone can be great practice, but so is making short levels where you put arbitrary restrictions on yourself. Make a level that only uses the Panser enemy, or one that uses a lot of spikes and different NPCs to jump across them. When you learn what specific tools work well for, you can make more varied obstacles as well.