The contractor can accurately price in (and insure against) technical risks like the risk of accidentally striking a cable while digging, and they can mitigate this as well (looking at the quality of cable mapping data, using detectors etc.)
What the contractor can't factor in is all the (local) government politics and bureaucracy. Where things fall on the financial year calendar, whether they will have to spend the money before or after April, whether they will have to pause works because a resident legally challenges the works, whether the client has even asked for the right thing, or if it will emerge while planning the work that they have made major errors etc.
When dealing with a well-specified, fixed-scope piece of work, you are right - the provider should eat that. When dealing with an uninformed non-expert customer (i.e. most public sector or government contracts), nobody in their right mind would take on that risk, except some of the big government outsourcing contractors, who would all quote insane prices based on past "actual costs" after factoring in all the nonsense from previous work.