I strongly the best decision by barcelona is to sell him, though pedri was one of very important players in barcelona. You said Neymar has suffered the same thing as Pedri. But, there is a worse case in Barcelona: Ansu Fati's. Ansu fati's career being ruined by his injury.
Pedri's injury proneness will hurt his stability next season. I don't see a reason for Barcelona to keep him much longer, and this is not my first time to see barcelona's player gets ruined by his injury prone.
It would be the best option for Barcelona to sell every player who is prone to injury as in the case you said. Because Barcelona is building a more solid team with players they can rely on, it would be wise for players who are prone to injury to be released before it's too late because Barcelona can also use the money from the sale of Pedri to buy other players at this time. Apart from that, several cases that are almost the same and have happened to Barcelona in the past can at least be used as important lessons for him so that Barcelona can remain on a strong path.