In the 2018 general election, Shafie's party of WARISAN together with the coalition of Pakatan Harapan (PH) are tied up with 29-29 seats with BN in the 2018 Sabah state election. Jeffrey Kitingan with his party of Homeland Solidarity Party (STAR) under the United Sabah Alliance (USA) which are not aligned from either the two sides, has won two seats in the election and subsequently emerged as the decision maker for the formation of a state government from the two sides. Jeffrey then decide to team up with the BN to form coalition state government with him appointed as a Deputy Chief Minister after Shafie Apdal the president of WARISAN disagreed to Jeffrey's permission to make Sabah's IC and solving the Illegal Immigrant issues in Sabah. Jeffrey Kitingan became the Deputy Chief Minister while Musa Aman from BN to become the Chief Minister for another 5 years under the new coalition government (Coalition of BN-GBS). However, situation change when six seats assemblymen from the BN allied parties of United Pasokmomogun Kadazandusun Murut Organisation (UPKO) and United Sabah People's Party (PBRS) switched their allegiance to WARISAN, giving Shafie an advantage with 35 seats which is sufficient to establish a valid state government. Earlier, Musa Aman had already sworn in as Chief Minister following the help of two seats from STAR. This situation left Sabah with two ruling Chief Ministers, the second in its history since the dispute between PBS and USNO in 1980s. The results of this events sparks a constitutional crisis in Sabah, and the need to review and change the current constitution so as to curb the "allegiance switching" of assemblymen, after the swearing-in ceremony of the chief minister. Another four seats assemblymen from BN allied parties of UMNO and UPKO switching their allegiance to WARISAN on 13 May 2018. The Yang di-Pertua Negeri Juhar Mahiruddin also had requested for Musa to step down, despite Musa still stressing that he still the rightful Chief Minister. Musa was then issued a letter from the TYT that he is no longer the Chief Minister effective from 12 May 2018 that was delivered into his residence on 14 May 2018. On 7 November, the high court in Kota Kinabalu decided that Shafie remained the legitimate Chief Minister of Sabah and dismissed a suit made by Musa who claimed his dismissal as chief minister was illegal and against the state constitution.
