The consequences for following an illegal order include being sued, being held in contempt of court, or being criminally prosecuted by a subsequent administration. They don't have the same immunity that presidents do because they don't have a direct vesting of authority under Article II.