As Tsimiski says, the Jante Law was written in 1933. It described a small Danish town that was severely behind the times, in 1933. Kind of a relic Victorian influence that came to the smaller trading towns in Denmark and southern Norway in the late 19th century. And was a stand-in for a small town the author grew up in and despised. It is a codification of attitudes he believed they had, and it is an exaggeration and a parody. It should not be taken as having legal force in the 21st century. Even in 1933 you would have found real attitudes different in most larger towns.
You corroborate my long held belief that the old Webber scheme of northern Europeans as being individualistic is absolutely wrong. They are, in fact, very collectivist. They're just not family oriented, which is a different thing altogether.
I suspect there is an assumption of homogeneity in Scandinavia which does not work in this case. Yes, languages are similar and politics are currently roughly similar in may areas.
But the Denmark of Jante was a small agricultural nation, exceptionally densely populated by Scandinavian standards. It has ten times the population density of Norway and five times Sweden. It has a history of trying to stay out of wars, an aristocracy owning the land, but a wealthy and free peasantry relative to other European nations.
Sweden has 1/5 the population density of Denmark, an aristocracy and I think -not my area- a peasant class that was bound to the land in what was basically serfdom. It has an exceptionally warlike history and was basically a rouge nation for centuries. There were centuries when 30 % of Swedish males died in wars outside Swedens borders.
Norway has 1/10 the population density of Denmark, no aristocracy, no serfdom, little in the way of cities and large towns, and only a small history of tenant farmers. The vast majority of the population owned their own land. In addition to the low population density, the geography is basically a fit of rage. Mountain ranges, glaciers, steep cliffs, rivers, lakes and abyssal fjords. Sometimes in the same square kilometer. Making the effective distance between people much larger than it looks on a map. For 1000 years or longer, males in the coastal regions where most of the population lived, have gone on long seajourneys to provide for the family while the woman has been in charge of the house, the economy and the valuables.
Norway and Sweden has a far, far more hostile climate than Denmark. Norway traditionally looks west, Denmark South and Sweden east.
The behavioral rules applying in a small town in Denmark had little authority over a fisherman/farmer in Northern Norway who lives with his family miles from his next door neighbor. Or A Swedish Saami reindeer herder. Or a Lutheran priest in an area maybe half the size of Denmark were we did not actually establish firm borders between Russia, Sweden and Norway until the 1700s or maybe early 1800s.
That being said, the reason the Jante law is still remembered is because we recognize that it does describe a real Scandinavian trait. I would say, in much the same way as Americans recognize the "ugly American tourist" stereotype as relevant without actually being one.
But the Jante law, at least these days, prescribe how you should display yourself rather than how you should perceive yourself. Excelling in something is absolutely supported. If you are accomplished in one or more areas, you will garner considerable (low-key) respect and approval from other Scandinavians -unless you are seen as bragging about it! It is a very serious social faux pas to act as though you are better, more valuable, smarter or otherwise above your fellow citizens. The best examples of this may be how the royals of Scandinavia behave.
On the subject of HG versus farmer genetics on individualism, I suspect the climate, geography, religion and history of an area has enough power to bury any genetic signal.