
No such column 'QuantityUnitOfMeasure' on entity 'Product2'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
But in Product entity field seems there.2 answers

Found it. It happened because of we have been using version 38 in apex class. It seems field is available for Apex query after version 39. We changed the version to latest right now (i.e. 40) and it worked fine.