How to stop WordPress creating URLs that don’t exist

There is no such thing as “URL that doesn’t exist” URL’s are just possible identifiers for pages on the internet. Every combination of characters as defined by the URL standarts is a valid URL.

You can’t control what URLs people are using to find content, if they want to use URLs for content that do not exist (and maybe can’t even exist) you have no way to stop them.