Renaming a comet makes sample contract impossible to complete.
(Possibly caused by the same bug as issue #25825)
When you get a contract asking for a surface sample from a comet, the contract's conditions seem to test the comet name the sample came from, not the comet ID it came from, or at least that's what appears to be happening.
Because I renamed the comet before taking the surface sample, and the contract refused to complete. But when I went back to the comet, renamed it back to what it was called before, and took a second surface sample after it was thusly named back, this second surface sample was able to complete the contract.