The cost of a pharmaceutical is not the raw material cost for the API, which is frequently a small fraction of the total cost. The majority of the cost is in meeting regulatory requirements (e.g. GMP production, traceable testing). In the case of this product, a volume of 200–300 units per year is so tiny I would expect the setup/teardown costs for batch manufacture to also play a role.
$27k sounds outrageously high, but the original $950 sounds equally outrageously low in light of the volume.