Pali vs. Magadhi

According to the lecture notes for Lesson 10, the Buddha preached through the medium of Māgadhaika vohāra– the language of Magadha – which was later known as Pāli as contained in the Tipiṭaka

Lesson 4 of 6103, Theravada Abhidhamma, however states that the Kathāvatthu contains a number of “Māgadhisms” – suggesting that an earlier structure of the document utilized Pāli and Māgadhi to differentiate the speakers of the different points for clarification

From the latter it seems that Pāli and Māgadhi are distinct, so to say that the Buddha taught in one and then it was known by a different name seems conflicting?

Anyone have any insight on this?
Clarification on dialects/languages and the likely truth of this first statement?