GDDR5 isn't necessarily cheaper since most DRAM manufacturers discontinued it years ago. Nvidia even had to switch the GTX1650 to GDDR6 starting from April 2020 due to GDDR5 shortages. When a memory type is turning into unobtainium, you usually end up paying a premium for surviving inventory just like most other stuff.
The bulk of costs are likely shockingly similar to the RX6500 since things like VRM, PCB, heatsink, etc. have a practical minimum size and associated costs, similar to how all HDDs under 2TB cost about the same due to manufacturing costs not having any meaningful scaling below all of the prerequisites for a single working platter.
I'd imagine the main reason the RX560 can be this cheap relative to the current market is because some suppliers are dumping inventory while they are still able to earn decent money from it to reduce the amount of stale inventory they may have to write off later.