Repeat after me: Neutral in a cable is always white, white is not always neutral.
Color in US cables are limited: mostly black and white, some red thrown in for good luck. The result can be very confusing.
Your old cables used black for one hot and white for the other hot. That is an allowed use of white in a 2-wire (plus ground) cable. The thermostat uses black for one hot and red for the other hot, which is what you would have if you pulled out all your white labels and marked them with red tape.
Note that this is different from red in a typical 120V switch cable. There red is typically used to indicated switched hot/load. But that isn't the case here.
The old thermostats were most likely purely mechanical (e.g., bimetallic) and did not need power to run themselves. Because of that, they could be inserted between one line and one load. Those could be, in your case, two black or two white wires, and I think picking black is the more natural choice - but it makes the white wires look even more like neutral wires because a bunch of white wires connected together in the back of the box is exactly what you would see behind a typical 120V switch.
The thermostat needs power, so it needs to distinguish between line and load. It actually doesn't care which load wire is which, because with 240V they are the same (unlike 120V where neutral is in certain ways different from hot). The inner wires on the thermostat are line and the outer wires are load.
You need to identify line and load (multiple loads in the "3 wire" box) cables and the rest is easy.
- Turn off the breaker.
- Disconnect ALL wires in one of these boxes. That includes finding the connected white wires and separating them from each other. Make sure all bare wire ends are safely away from each other and the metal box.
- Turn on the breaker.
- Use a non-contact voltage tester (NCVT) to determine which wires are hot. You should find exactly one black and one white in each box that are hot, and they should be in the same cable. If you don't, stop and ask for more help.
- Turn off the breaker.
- Put a piece of red tape on the hot white wires.
- Put a piece of blue tape on each of the black wires that was not hot.
- Put a piece of blue tape on the outer black wire on the thermostat.
- Put a piece of yellow tape on each of the white wires that was not hot.
- Put a piece of yellow tape on the outer red wire on the thermostat.
- Connect wires by color (natural color if no tape, tape color if there is tape).
- Turn on the breaker.
- Test the thermostat.