In May 2007 he allegedly suffered a stroke and was transferred from Beon jail to hospital and placed under guard. A group of supporters and relatives then reportedly retrieved him from hospital by force and escorted him to the office of the Electoral Commission, where he completed an application to stand as an independent candidate for his previously held seat of Rai Coast Open. Despite a recent constitutional amendment that disallows anyone convicted of an indictable offence from running for office, the Electoral Commission accepted his candidacy on the basis that his legal appeal was still underway. This decision later attracted considerable criticism. He remained in hospital until 7 July, conducting his campaign from his hospital bed. In the 2007 general election, Yali won the Rai Coast Open seat from a field of 28 candidates. His level of support, despite being imprisoned, was widely attributed to fear of his reputation for sorcery. On 10 August, the Supreme Court quashed Yali's appeal, nullifying his election. The Electoral Commission said that a by-election for Rai Coast Open would be held within three months. The court was widely criticised for having deliberated on the case for a year, given that a by-election would have been avoided had the court come to a decision before the election. The by-election was held from 10–16 November 2007. His brother, John Tuna Yali, contested the election and stated that he was confident he would win. A total of 21 candidates contested the by-election. The election may have been delayed in some areas for a few days due to weather problems, but by 20 November 2007 voting had been completed in most areas. For the first time, the ballots were counted electronically; writs were returned on 7 December 2007. The by-election was won by Kiap Niuro Toko Sapia with 6,961 votes, while Henry Baiyema was runner-up with 4,503 votes. Sapia contested the election as an independent after having contested the general election as a PNG Country Party candidate; he announced he would join the National Alliance Party.