Yeah that’s not gonna work.
I think you have to align incentives and the contractual level. For example, don’t pay by the hour, Pay for an API. Mandate that it’s documented in a machine-readable way. Require it to integrate with your centralized authentication and logging services. Mandate thorough, human-friendly documentation Programmatically validate as much of this as possible, add periodic human review (ie surveys, interviews).
The goal is to treat each team as a vendor for their service. You hold them accountable for the product and pay them for outcomes.