Jake McMahon was told by Court of Appeal judges that his challenge had wasted the time of the court