By the time 5e came out 4e was dead for two years while Pathfinder was still going strong and WOTC had published 3.5 core books, 1e corebooks, 2e corebooks and a 0e anniversary set. 4e was unsupported and lay fallow. 3.5 was a huge seller, compared to 2e which flatlined after a year and a half. So it wasn’t a poor seller and its success was why Hasbro thought it could do more with 4e and the plans they announced for it and the unlimited budget they threw at the developers. It failed within a time frame to meet the expectation and was slashed. It wasn’t even cancelled by Hasbro, it was iced. That’s why it was nostalgia products for 2 years. They had a miniscule budget. They had to farm new material out for others to work on. OSR isn’t a good comparison because you’re talking several games, of varying systems from White box styles to 1e and BX which are not all that related but share a common ancestry and the various sub games in the OSR with changes that create fiefdoms within the OSR like LOTFP.