Shipment validation using TRTVENLIVV fails with dimension values

SOLVED

I'm trying to validate a shipment from script using 

Call VALIDATION([L]SDHNUM) From TRTVENLIVV

But this always fails with the error message:

<0001 Shipment H00000001 Product Z002 Analytical dimension : HEALTH Non-existent dimension value

This particular shipment was created by duplicating one that was already validated, so clearly the values are OK. If I use the 'Validation' button on the Shipment window, it will succeed.

I've used this script at other sites without this problem, so I'd expect it to work for this new customer. This customer has: Release 2021 R1 (12.0.25), Version 90.25.61, Runtime 93.2.50

What do I need to do to resolve this?