real talk; the answer is that the Mechanicus are too powerful for the Imperium to actually fuck with. For one, they were an already established and very strong empire on Mars while the Emperor was just getting humanity back together after a great collapse on Earth, so they negotiated the alliance from a position of power. For two, the Imperium gets every gun, every ship, every tank, every drop pod, every Titan, literally everything other than I think food and manpower for their armies from the Mechanicus. If you wanna start investingating their "definitely not-AI," you gotta be prepared to have your shipments of Leman Russes to suddenly start getting lost.