With data of a given firms costs, can we in fact get an accurate estimate of its profit function and supply function?
Here's a paper link where they picked up a $R^2$ of over .99 I don't think this is particularly unusual or strange of a result, either. In estimating costs for firms in public utilities, I recall doing numerous exercises with real data from various utilities. I typically got $R^2$'s in the 0.95's or higher, so I feel they are fairly accurate within sample.
This means economists are fairly good at estimating what a firm's per-unit costs are if we have a good knowledge of their total capital stock and expenditures, and we stay within the bounds of our sample.
However, if you are asking about very far out-of-sample predictions, or systemic shifts in the market, then you may find less success.