Decoder are not supposed to lose any program setting changes you make to them over the life of the locomotive. Like wise it should never lose it settings when power is lost. You should be able to set the decoder and forget as in use it the way you inteded for it to work for the reset of its life. ASSUMING there is nothing wrong with the decoder, anytime a decoder losses it programming that DOES NOT involve you giving the decoder a reset command means there is a problem between the decoder and the DCC system. Given there never been a single example of ANY command station issuing a reset command all by itself and the decoder has a long track record of working fine on other layouts, the evidence will point in the direction of what is UNIQUE about your layout. That is the layout wiring. No two layouts are wired the same way. Unique as a fingerprint.A Human analogy is your head/brain(Decoder Chip) got hit with a baseball bat (Strong Voltage Spike). Your not dead (blown up) but you do see stars and have memory loss (lost some program values). You need to relearn what you forgot (Re-programming).
As it turns out, a decoder losing its programming is just a LESS extreme case of the same electrical issue (voltage spikes) that causes permanent damage (Blows Up) and requiring return of the decoder for repair.
To learn more about both root problem and the solution, go here:
Decoders blowing up?