With the page template unlinked from the site, take a look all all the ".js" files loaded in the head tags, especially one that FlexibleMap might load. Make sure that script is loaded when the page template is linked to the site, and loaded only once.
If you don't see a .js file, look for actual code in script tags containing FlexibleMap code. The way I'd do that is just search for "flexiblemap" in the page source on the page where the map displays correctly.
Once you find the library/code that's not loading on your custom page template, you can fix it by loading the library/code.