I read that high-speed train tickets in China might be purchased online either via the official website or some third-party agency such as chinahighlights.com or china-diy-travel.com. Is there any downside in purchasing high-speed train tickets in China via the official website, instead of third-party agencies? I wonder whether purchasing via the official website is always preferable or going through some third-party agency has some upside (e.g., price, ticket availability, etc.).
Availability is the primary reason to go via an agent. Generally this is not an issue, but for popular services like trains to Tibet during the summer tourist season, publicly available tickets are snapped up almost instantly (both by legitimate travellers and by scalpers) and can be next impossible to obtain via the official website, particularly if you want the nicer seats/cabins. Agents have access to additional inventory, and can thus buy tickets even when you can't.
All that said, the Chinese authorities have also been cracking down in scalping, with ID requirements making this harder. In 2019 an automated wait-list system was also implemented, further reducing the need for passengers to resort to scalpers.
The other advantage is that it's easier to go with an agent who can surmount the language barrier, although now that 12306.cn is available in English this, too, has become less important.
The obvious downside to using an agent is that they charge money for the service, and the markup can be quite unclear to boot.
For what it's worth, I used China Highlights when arranging my own trip to Tibet a few years back, which requires using an agent anyway (independent travel is not permitted). They were generally competent and managed to secure both our Tibet permits and those elusive Tibet train tickets without too much hassle. They weren't cheap, but the train fare markup was a rounding error in the grand scheme of things. Your mileage may vary.