During the 1926 coup d'état, he defended the democratically elected government of Stanisław Wojciechowski. After the coup, in 1927, the new sanacja regime of Marshal Józef Piłsudski charged him with bribery and embezzlement. Following an official investigation, he was court-martialled and demoted to private first class, expelled from the army and sentenced to five years in prison. Karol Popiel later claimed that accusing Żymierski of corruption was a kind of political revenge on the part of Józef Piłsudski and was supposed to indirectly discredit Władysław Sikorski.