The upstream name of GetWitnessHash() is very confusing as it is not a hash of the witness data for the transaction, but rather a hash of the full serialization of the transaction including witness data. This goes beyond confusing to downright wrong with CT/CA where the witness hash will be a hash tree of witness data (rangeproofs, surjectionproofs, script signatures, etc.) and NOT have any transaction data.