The maximum principle with lack of monotonicity