To understand what is happening, you need to understand the difference in SharePoint between a Site Definition and a Web Template:
Although often used interchangeably, they are different and are treated differently within SharePoint. Site Definitions, whether out of the box or custom, live in 14 hive\TEMPLATE\SiteTemplates. On the other hand, Web Templates save customizations to an instance of a Site Definition to a .stp or .wsp file, which allows that site to be replicated in other site instances.
So, here is the real problem: even Microsoft gets confused in the difference between Site Definitions and Web Templates. Because when they named the WebTemplate property, they meant Site Definition, not Web Template.
Notice what MSDN says:
SPWeb.WebTemplate Property
When you create a custom site template by saving a site as a template
and then create a new site from that template, the WebTemplate
property contains the name of the site definition from which the
custom template derives, not the name of the custom template. Thus if
the site that was used to create a custom template was itself created
from the standard team site definition, the WebTemplate property of
all sites that are created from the new template will return "STS"
SPWeb.Configuration Property
When you create a site template by saving a site as a template and
then create a site from that template, the Configuration property
contains the ID of the site definition configuration from which the
site template derives.
(emphasis mine)
This supports what you discovered in your question. So how do you determine what custom Web Template was used to create a site? I'm not sure it is possible. Because if it was possible, I would hope that MSDN would have provided another sentence or two telling how to accomplish what they just explained these properties don't do. Also, in searching around, I have found this question asked a couple times, but there has never been a satisfactory answer.