The rabbis didn't contradict Rambam, the rabbis are in Gemara, and Rambam himself report this law.
Rambam isure bia 14.2
יד,ב ומודיעין אותו עיקרי הדת, שהוא ייחוד השם ואיסור עבודה זרה; ומאריכין, בדבר זה. ומודיעין אותו מקצת מצוות קלות, ומקצת מצוות חמורות; ואין מאריכין, בדבר זה. ומודיעין אותו עוון לקט שכחה ופיאה, ומעשר עני. ומודיעין אותו עונשן של מצוות.
Before conversion, we teach him principles of religion, unicity of G-d and prohibition of idolatry, with details, we teach him few light mitsvot, few heavy mitsvot, quickly, we teach him isur to not leave leket, shichecha and pea and maaser ani, and punishment of mitsvot.
This is not Talmud Tora but knowledge about what is to be Jew.
The Rambam you report is in melachim chapter 10 halacha 9
[ט] גוי שעסק בתורה, חייב מיתה; לא יעסוק אלא בשבע מצוות שלהן בלבד. וכן גוי ששבת--אפילו ביום מימות החול--אם עשה אותו לעצמו כמו שבת, חייב מיתה; ואין צריך לומר אם עשה מועד לעצמו.
Non Jew who "take care of" Tora is punishable to death. From the text before and after, we understand that the problem is when he appropriate Tora to make his own religion, but if he wants to follow Tora as Israel do, this is an approach of conversion and there is no problem.