I can make some speculation here, so if anyone knows better and I'm wrong about something, do feel free to correct me...
Why was DDR2 less expensive when DDR3 first came around?
Why did DDR3 get super cheap in 2011 and then get more expensive after?
Why was DDR3 cheaper than DDR4 at first?
Those might explain the general idea. Basically, the first and third should be an example that an incoming RAM generation is always more expensive at first, and the second one also gives an example that price can ebb and flow. Both can happen simultaneously, too.
Yes, DDR5 has been out for some years now, but platform longevity is also longer than it's ever been, so previous generations are being kept around and in production longer (meaning lower prices for them), as DDR3 has shown.
You also need to consider that performance DDR4 is pretty much gone as far as I am aware (?), so much of what's left is perhaps good but not premium stuff so pricing will be even lower. Even if you look at whatever a particular brand is calling the same product label, the chips and ICs tell a different story.
Lastly, not all things scale linearly in life. For example, as recent capacity increases have shown (RAM capacity increased by 50% instead of doubling 100% and VRAM is about to do the same), scaling is getting harder with a lot of things in the tech world. So it's not always as simple as "thing is twice of this, it should be no more than twice as costly". Sometimes, it's more (or even less).