Permalink / sub-template issue

It is hard to tell exactly what you’ve done, and it sounds a bit messy, but I think you’ve created “Pages” using the child templates as the “Template” under page attributes.

enter image description here

That, or you are linking to them directly with wp-content/theme/themename/templatename.php. You never want to link directly like that, but if that were the case I have no idea how the search would “get the permalink”.

I don’t know how else those templates would “its own URL” and either way would be wrong.

You should be creating all of the pages– parent and child– using the “main template” as the “Template”. If that template is constructed correctly, everything should load in context correctly.

You should also look into get_template_part.