Here's the information for testing the downstream O2 sensor circuits. For the first 3 wires, you'll be measuring the resistance from the sensor connector pins to various pins on the 2 ECU connectors, which are marked 'M' and 'K'. Each of the 3 measurements should be zero ohms, or very close to it.
The dark green wire at connector position A gets tested against ECU connector pin # K53.
The light green wire at connector position B gets tested against ECU connector pin # K36.
The brown wire at connector position C gets tested against ECU connector pin # M2.
For the brown wire at connector position D, simply check for battery voltage with the key at ON.
It's really surprising to have no performance problem when there's an active flashing random misfire taking place. It might help a lot to get that P0141 eliminated so that the ECU keeps the loop closed. If you can accomplish that, the fuel trims might be a help in figuring out what's going on. With bad MPG, it suggests rich running, which would take it back to A/F ratio problems.
One other thing that comes to mind is the possibility of that O2 connector being so messed up that it's back-feeding the ECU. I've never heard of anything like that, but with electricity there's probably a way for almost anything to happen, given the right conditions.