Elijah Muhammad was the head of the Nation of Islam when Malcom X was killed by Nation of Islam guy. I don’t think they ever proved that Elijah ordered it.
Malcom X found out about his philandering and children born to mistresses. They also began to have some differing political views.
And MX had become a sunni moslem and did the hadj, had met with whoever the king of Saudi Arabia was at that time. NOI is quite different from “regular” Islam.