What's true is that Ramanujan spent an absolute significant amount of time working on math problems of all kinds, and the vast majority of his work was simply incorrect. In fact one thing Hardy appreciated and found most extraordinary about Ramanujan was not what Ramanujan managed to get right, but the ways in which he managed to get things wrong since that kind of revealed some unique insight into how Ramanujan went about solving problems.
Of course that is never what is showcased about him, instead we get infamous stories such as how Ramanujan seemingly figured out in a matter of seconds that the number 1729 is the smallest number expressible as the sum of two cubes in two different ways. What the story leaves out is that Ramanujan did not just figure this out on the fly but had been working on trying to prove Fermat's Last Theorem for years and as part of that work he had come across the number 1729 since it's related to elliptic curves (the basis of which would eventually lead to a proof of Fermat's Last Theorem).
At any rate, none of this is intended to diminish Ramanujan in any way, on the contrary my hope is to celebrate the very hard work and dedication that Ramanujan put towards mathematics. He is not someone who just divined correct solutions to complex math problems out of thin air but instead he spent countless hours for decades on end devoted to his passion and persevered through much trial and error. The only things we see of his work are the things he got right, and to that end it may seem like his accomplishments are magic; the truth is that they were anything but.