All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
In Islam, inheritors have rights according to the Sharee'ah. So if a person writes a will specifying the details of the inheritance, then this will is invalid unless all inheritors agree with it. The Prophet said: “There is no will for an inheritor.” [Ahmad and At-Tirmithi who said that it is a Hasan Hadeeth]
Imam Ibn Abdul Barr said: “All Muslim scholars have agreed upon this ruling.”
Therefore, the will mentioned in the question is not valid as long as it includes something that is not in accordance with the Sharee'ah.
Now there are two choices:
a) The inheritance should be distributed among all inheritors according to the Sharee'ah.
b) If all the inheritors agree with the will, it will become valid.
For more benefit that there is no will for an heir, please refer to Fataawa 26630, 289471, 302158, 312970, 317632, 336970, and 350614.
Allah knows best.