Juventus got Jonathan David for a striker, hence why they didn't get Osimhen. Sure you may think Osimhen is better, but the difference is that you need to pay 20 million a year on Osimhen plus 75 million transfer fee, whereas David was free, and cheaper salary. They already spent 100+ million, and with their sale, they are at minus -50 million right now.
Juventus cannot afford a transfer of this magnitude due to financial problems. Napoli could only earn a high income by sending Osimhen abroad and that transfer was made by a surprise team, Galatasaray. Clubs in Turkey are not doing well economically, but Galatasaray mobilized everything for Osimhen. Osimhen will be the new Maradona of Galatasaray. Napoli didn't want to sell a big star directly to their arch rivals. Therefore, Osimhen not going to Juventus was a logical outcome both in terms of relations between the clubs and the player's career planning.