What is your issue?
When provided as a data variable, an astropy Quantity is kept as a Quantity. But when provided as an index through the coords argument when constructing a Dataset, the Quantity is converted to an array, erasing the units. Is it possible to fix this?