John Swinney’s plan to cap food prices ‘not needed’ and ‘ill-conceived’ says former judge