I think this is a misconception.
In the 90s it may have been true - windows was focused on user experience on the desktop. Pre- internet, security just wasn’t relevant.
Even in that era though, Linux was running on servers in universities et cetera managing many users.
I guess this is where the reputation arose.
These days I don’t think either is inherently more secure than another in a general sense.
For specific uses cases one might be more “reliable” than another just because it’s used more and therefore has more people looking at it. For example, the vast majority of Web servers are in a Linux environment, but the vast majority of on premise email servers would be Windows.
What I’m saying is, in 2024 the general security of each platform is going to be comparable, and only a very small component in your chain of reliability. Like if you develop a threat model, and write policies, and maintain behaviours in practice, the underlying security provided by the environment isn’t really that relevant.
I’m trying… I’m trying real hard to be the shepherd ringo.