Court warns Lord Chancellor over contracting