`$shipment->getItems()`?
In the main app shipment items === inventory units
Hence the double states you have: Unit::ShipmentState and Unit::InventoryState