New South Wales Premier Dominic Perrottet has sacked a cabinet minister after an anonymous complaint from a staffer.