The resignation of veteran Labor and Liberal MPs within hours of each other on Tuesday has rocked both parties.