This is true, and a strong point for why he was a psyop to scare whites into supporting the "moderate" MLK as opposed to being a serious figure.
Weirdly though, he publicly denounced race-mixing in his speeches as being bad for both blacks and whites, and was openly friendly with some neo-Nazi types. Leading me to think he was artificially promoted in media to be used as a psyop rather than being "in" on the psyop himself. Him being assassinated shortly after he began to moderate his views, would fit this theory.
Ironically, Malcolm X seriously mellowed out after embarking upon his first Hajj as a Muslim. The reason being that white, black, Latino, Arab, Indian, Malay, Chinese, and all other Muslims across the globe united together in Mecca to circumambulate the Ka'aba. Basically, Malcolm X had an extended break from Elijah Muhammad (and the broader Nation of Islam by extension) and realised "wait a minute, Islam ain't just a tool for resistance against the white devil?" In 1964, he did an
interview where he said something to the effect of "Islam and the Hajj were the solution for me, personally, but so long as there's racial injustice, I must continue forward with the struggle" or something like that. I honestly can't remember at the moment.
Now, one must ask "why would a break from Elijah Muhammad so drastically alter Malcolm X's views?" Well, his Hajj in 1964 coincided with him embracing Sunni Muslim orthodoxy. Bear in mind that it wasn't until
VERY recently that the Nation of Islam was wholly distinct from all other forms of Islam by innovating new theology and dogma (to phrase it mildly). You can point and laugh at the inconsistencies and hypocrisies of Muslims past and present, but Islam foundationally
does not uphold one race as superior to all others. It's meant to be the
final revelation for
all mankind; you can't spread the final revelation to
all mankind if the hedonist sultan can be a Muslim, but not his virtuous slave.
When you see photos where hundreds of thousands, if not millions, of people are circumambulating the Ka'aba, it ain't just Arabs or Persians or Pakistanis who are doing it. You also have Berbers from the Maghreb, Subsaharan Africans from the Congo, Indonesians and Malays from maritime Southeast Asia, even the odd Amerindian from Latin America doing the same thing (among countless other groups). The act of Hajj is one that's long debated among scholars past and present, but it must be said: stripping away all the theology and religious dogma behind the act still shows the pilgrimage has value as an event where all identities and divisions fundamentally collapse and only Muslims remain.
Elijah Muhammad et al deviated so far from this tenet of Islam, that coupled with their own innovations and infamy, led to the first Muslim advocacy groups in the USA disavowing the Nation of Islam, citing them as categorically deviant. Even today, long after the Nation of Islam abandoned Yakub and embraced Sunni orthodoxy, there are more than a few Muslim advocacy groups nationwide that explicitly distance themselves from the Nation of Islam. Malcolm X got shot because conventional Sunni orthodoxy and a life-changing pilgrimage made him soften his views on the white man. You can't have that when you're an explicitly black supremacist group, and you certainly can't let one of your own group's most important public figures categorically break from in-group orthodoxy.