This is all completely valid. As part of Neymar's contact, both Neymar and Barcelona agreed to the value of the release clause - note that under Spanish law, all employees have a release clause in their contracts, and this applies just as much to footballers as to anyone else (for more details, see this ESPN article). PSG made an offer for Neymar which met the value in the release clause, so after Neymar paid Barcelona the appropriate fee, he was then free to move to PSG - and that's what he did.
Nobody has "broken" the contract here, as Spanish law mandates that any employee can release themselves from a contract - the only question is over the fee to be paid, and in Neymar's case, that was specified in the contract. There are no legal complications, because the lawyers who wrote the contract already thought about it.
(This ignores any possible question as to whether PSG will be in breach of UEFA's financial fair play rules due to their expenditure; that's a different question from the validity of Neymar's contract as it's between PSG and UEFA, not PSG, Neymar and Barcelona).