In addition to Stephen's comment below your question, which should help you troubleshoot the issue (i.e. make sure the URL's don't resolve; ensure the links are absolute), consider the following:
The 404's that Google returns in GSC are not always reason for concern. If Google can't find a page or a resource that doesn't exist on your site, isn't ranking in SERPs, or isn't in the index, it is perfectly okay to let it go to a 404. As Google says in GSC, "Generally, 404s don't harm your site's performance in search, but you can use them to help improve the user experience."
If you're using a CMS, those have the ability to produce such errors. You may automate a URL generation process via a plugin/module, and may later find that something's been generated incorrectly. If this can be traced to a plugin, you can either modify your plugin settings and run multiple tests; figure out what's going wrong in the plugin's code (PHP, JS) and if it's conflicting with another plugin; or failing that, use a different plugin.
Some CMS platforms, like Drupal, will generate URL's for nodes like blocks and taxonomies, which should not appear in search. Be on the lookout for this functionality as well, and make sure you "noindex, follow" everything you should.
You can further troubleshoot by using Screaming Frog, or any of the numerous Chrome browser add-ons, to analyze your broken links on the website and see where they're coming from. GSC also gives you this info from its Crawl Errors -> Linked From tab. This will help you discover if the links are internal or coming from another website, allowing you to either fix the links or contact the site owner.
Also, make sure you're using canonical tags on your pages. These tags should be present on every page you want in the index (so all those pages in your XML sitemap), pointing to itself. That way, any additional URL version that is accidentally generated will lead to the page that's meant to be in the index.