You probably have a failed rear wheel which are not sending signals each time it is rotated.
In spite of the fact that the 40D is an old camera, you might still find camera repair shops that still work on them, so inquire about CLA plus thumbwheel cleaning/replacement.
Just within the past 6 months my venerable 5D suddenly died in the middle of shooting. I found a shop that still worked on them, and they quoted $400 to replace a failed circuit and to also do the mirror fix (which had never been done) and CLA the camera, and that was still less expensive than buying a used, more worn looking 5D with an unknown number of shutter actuations...and unfortunately the world was not impressed quite enough with the 5DIV to drive down the prices for the 5D3 and 5DII!
Like you, I still have my trusty 40D. The 50D had more pixels and worse noise than the 40D, and in the 60D (and onward) Canon departed from the categorization of the nnD as the 'prosumer' and migrated them more in the direction of nnnD 'snapshooter' user interface (with elimination of a PC sync socket and the elimination of the joystick, etc. and then there was the transmissive display in lieu of a finder with exchangeable focus screens, so no more En-S precision focusing screen). So I never found sufficient desire for upgrade vs. the (to me) newer compromises. And then there is the fact that the relative gain in resolution at the cost of disk capacity consumption, when I rarely even push the capabilities of 10 year old cameras, is not a motivating factor either.
- 1.4x the linear resolution for twice the disk capacity consumption: 40D vs. 7DII
- 1.5x the liinear resolution for 2.4x the disk capacity consumption: 5D vs. 5DIV
I have to admit to feeling more and more like my POTN title dubs me (old flatulence), but video in the dSLR carries zero appeal to me and the 'next revolution' simply has not happened...the industry and the public has succumbed to the 'resolution' advancement in spite of the fact the world was convinced less than a decade ago that resolution was not the stuff of revolution. And just how often do I need five or six digit ISO with low noise?! If the 'old stuff' works just fine, sometimes we have no real need to pull money out of our wallets to impress others!