I am a DM of about 3 years playing (I'm in university at this point) and I created my own campaign I want to play with others. (for those who want to know; it's the forgotten realms plagued with a zombie virus and the players must deal with the ruins of the previous world (5e)) I decided to try and play it solo to troubleshoot my difficulty classes for certain things and making sure my encounters were balanced for the players who would soon explore my world... so I made some characters.
I have found that playing solo in your own fully developed world not only clarifies how balanced it is, but it can be a really fun experience.
I believe you can play D&D solo, even with your own campaign. The way I did it was fully investing in creating the characters' personality and backstory and letting that determine their actions. From there you can imagine in as much detail as you want the extent to which the characters interact and go through the decision making process as well as how they play with others and face surprises or problems.
As for problems that stem from me knowing the contents of my game too well to play it myself: I just roll history/arcana/investigation/perception/religion etc checks to see if my characters figure it out for themselves or create a new solution to the problem that I may not have came up with if I wasn't roleplaying the characters in my head.
I track what goes on and my timeline on a separate page and keep good track of my character's loyalty/renown, skills, spells and slots, backstory; personality; and changes to their mental state, inventory, NPC's (yes I make backstory and personality for the important ones in similar detail as the party characters) and from there I just let the campaign unfold like a rube goldberg machine.
Doing something similar to what I described above would be an awesome way for a player who knows rules, character optimization, and roleplaying like the back of their hand and just want to troubleshoot their world or play on their own for fun.