Private companies that sign contracts to deliver public services and then fail to do so should never be allowed to pay dividends to shareholders. A shareholder is a company owner. A company owner who takes public money, doesn't deliver, but takes profit, should be prosecuted.
I thought the standard-bearer offender, Thames Water, had come up with some accounting trick whereby it can pay "dividends that are not dividends", precisely in order to evade the similar legal principle that dividends can only be paid out of operating profits, not out of borrowed cash.