All lines of the form
if ((millis() - changedButtonOnMs) > MAX_BOUNCE_MS) {
should instead read
if ((long) (millis() - changedButtonOnMs) > MAX_BOUNCE_MS) {
to match the pattern described in https://playground.arduino.cc/Code/TimingRollover
The bug will cause strange things to happen after running constantly for a few days.
All lines of the form if ((millis() - changedButtonOnMs) > MAX_BOUNCE_MS) { should instead read if ((long) (millis() - changedButtonOnMs) > MAX_BOUNCE_MS) { to match the pattern described in https://playground.arduino.cc/Code/TimingRollover
The bug will cause strange things to happen after running constantly for a few days.