On 9 May 2018, Sharkie announced her resignation from the House of Representatives following the High Court of Australia ruling that Senator Katy Gallagher was ineligible to contest the 2016 election as a consequence of the 2017–18 Australian parliamentary eligibility crisis. Like Gallagher, Sharkie had failed to complete renunciation of her British citizenship before nomination in the 2016 federal election. She contested the 2018 Mayo by-election on 28 July, and was returned to parliament with a swing in her favour.