Nonmonotone incidence and saturated treatment are incorporated into an SIRS model under constant and changing environments. The nonmonotone incidence rate describes the psychological or inhibitory effect: when the number of the infected individuals exceeds a certain level, the infection function decreases. The saturated treatment function describes the effect of infected individuals being delayed for treatment due to the limitation of medical resources. In a constant environment, the model undergoes a sequence of bifurcations including backward bifurcation, degenerate Bogdanov-Takens bifurcation of codimension 3, degenerate Hopf bifurcation as the parameters vary, and the model exhibits rich dynamics such as bistability, tristability, multiple periodic orbits, and homoclinic orbits. Moreover, we provide some sufficient conditions to guarantee the global asymptotical stability of the disease-free equilibrium or the unique positive equilibrium. Our results indicate that there exist three critical values r_1, r_2 and r_3 for the treatment rate r: (i) when rge max {r_1, r_2}, the disease will disappear; (ii) when r<min {r_1, r_3}, the disease will persist. In a changing environment, the infective population starts along the stable disease-free state (or an endemic state) and surprisingly continues tracking the unstable disease-free state (or a limit cycle) when the system crosses a bifurcation point, and eventually tends to the stable endemic state (or the stable disease-free state). This transient tracking of the unstable disease-free state when {mathscr {R}}_0>1 predicts regime shifts that cause the delayed disease outbreak in a changing environment. Furthermore, the disease can disappear in advance (or belatedly) if the rate of environmental change is negative and large (or small). The transient dynamics of an infectious disease heavily depend on the initial infection number and rate or the speed of environmental change. Supplementary InformationThe online version contains supplementary material available at 10.1007/s00285-022-01787-3.