They can later claim that the crew and captain acted on their own will, without orders from the Chinese leadership. They can duly punish the captain and crew or disavow the vessel and declare them renegade, disallow them to fly their flag. But without such a declaration, a nation such as China is responsible for the conduct of their fleets, be they civilian or military. And any vessel they allow to fly their flag is part of their (in this case civilian) fleet.
https://en.wikipedia.org/wiki/Flag_of_convenience
> A ship's flag state exercises regulatory control over the vessel and is required to inspect it regularly, certify the ship's equipment and crew, and issue safety and pollution prevention documents.
Because US law is strong in this regard, the US military is by far the largest contributor to the count. Less than 200 civilian vessels are flagged in the US; https://www.statista.com/statistics/652126/us-flag-oceangoin....