I've often wondered along similar lines, at the origins of what amount to archetypes that populate fantasy RPGs. There is no single source and the many threads of history when untangled show major punctuations across many centuries and even millennia, but during the 20th century all of these influences somehow conjoined and established not only the personae but the mythological and environmental elements of the general fantasy RPG mythopoeia. All of the authors named above and others well known besides have certainly contributed to this, but there must be so much more involved that I don't think we can fully comprehend. Tolkien is undoubtedly the nexus for us in the twenty first century, but in a wider sense you have figures like the brothers Grimm and Goethe, among many others less familiar.
I suspect that much of it is due to the way so many different cultures encountered each other in North and South America during the colonial period that ramped up considerably during the Industrial Revolution and a sort of alchemical process unfolded leaving us with a psychic distillate bearing the major features of each cultural heroes journeys and mythology, an amalgam of what is universal in nature but particular only geographically and linguistically. Concepts such as ultima Thule, the world tree, the elevated home of the gods, infernal and chthonic creatures, basically those intangibles that most likely originated in early tribal societies within shamanic contexts, merging with the different cultural figures who appear under different names and feature in different roles as legendary heroes, warrior poets, sainted kings, etc.
In a sense, the material that was later chronicled as the chivalric romances and Matters Of developed under similar conditions as the modern fantasy genre, with barbarian tribal groups in the hundreds and thousands forming alliances and consolidating into new, much broader groups through which isolated, local animistic beliefs and the sense of tribal identities were constellating by force amidst a backdrop of massive displacement and reorientation as the period of migration ended. And these new-ish cultures settled into conquered territories that retained many of the formerly Roman traits, yielding artifacts and relics like the Gothic Bible. Bards, poets and priests recorded much of what had been repeated orally in song or epic form for so long that nobody knew where it came from, changed up a bit of course to accord to local peculiarities, and as literary forms developed so did the urge to preserve these things despite the "danger" (as the priests saw them, anyway).
The way that these things are remembered in a culture is so innate that it almost seems to be genetically inherited. Today we recognize the figures and scenarios of the generic heroes journey as Campbell described it and on a mystical level Jung intuited it, but I think the endless recurrence of pseudo-medieval adventure stories (even the banal and commercial) has a very deep significance for modern Western culture, as one which no longer has any roots and with very few exceptions maintains only the most trivial and ephemeral of traditions. There is a sense of heritage lost that is palpable in these stories, even if regurgitated for easy money it is only easy because of this void. When cultural identities are erased and replaced with a plastic facade a new one begins to emerge, as happened to the Germanic tribes from whom the overwhelming majority of this imagery and personae was taken. Ours is just exceedingly demented because of the internet and automated mass memory retention. You can trace almost any detail in a fantasy RPG to central and western Europe between the Iron Age and the Reinassance, and somehow this has a profound appeal to people, including many people who are not even remotely of Germanic ancestry, and this is fascinating to me. Certain things transcend cultural boundaries and the idealized version of imagined medieval Europe absolutely is one of them. How the contemporary RPG class archetypes were cemented can be demonstrated with war games and the advent of Chainmail and Dungeons & Dragons, but the chivalric romance influence is just as vital to its appeal as the mechanics of play and I think it has to do with the very ideals of the chivalric code and the precedent notions of honor which are next to impossible to abide but remains the high watermark of cultural progress.