Ka-thunk

My 1998 Volvo wagon now makes a loud noise when slowing down, and moving from 12 - 15 mph. It’s a 4WD, the noise comes from the rear axle area, and I can best describe the noise like a very loud downshift, or the clanging noise of a pile driver (just not that loud) Even when I coast in neutral, it happens. It only happens when slowing down, at 12 - 15 mph, not when speeding up or in normal travel My mechanic says it’s not dangerous, and is pretty sure the 4WD is not engaging properly. But nothing is loose and the driveshaft seems fine. He advises letting it stay as is, rather than spending a lot of money taking the rear axle apart. He is not sure what the problem is. The issue usually goes away when I drive for 20 miles or so, but comes back as soon as I restart and go. Any ideas? Does it make sense to replace the rear CV axles, which I can do myself, or is this just a waste of $$? I appreciate any ideas.