No, you can't just fit a secondhand unit unfortunately.
The code as you describe it wouldn't have been stored twice in the vehicle. As a drivetrain emissions related code, it would have been in the engine ECU. An OBDII only reader can only retrieve generic engine and drivetrain codes which are standardised across all vehicles, so as an engine related code you would see it reported using an OBD reader, which can only connect to the engine ECU (and a transmission ECU if the type of transmission in the vehicle has such a unit e.g. normally a robotised or auto box).
If you then connect to the same vehicle with a multi or all systems scanner without having cleared the code (or with the fault still present, in which case attempting to clear it will fail) it will show the same fault, again retrieved from the engine ECU during its scan of all the onboard systems. But the all systems scanner, if it is programmed for your make or model of vehicle, can also retrieve other non OBD compliant fault codes (manufacturer specific non-OBD compliant codes) from the engine ECU and any other ECUs on the vehicle that it has been designed to connect to, which an OBD only scan tool can't see.
VIDA and VDash are all-systems diagnostic software specifically for Volvos, as
MES is specifically for FCA vehicles. You can use a Super J2534 (Mongoose Pro JLR) clone with both programs as well or instead of the DiCE. Unless you buy at enourmous expense from Volvo, all DiCE are Chinese clones. A few years ago, there used to be some good ones with the same circuit boards as the genuine DiCE, but they now mostly just have PCBs from cheap junk connectors shoehorned into them