The OP's problem is interesting not only as finding a specific circuit solution but also from a conceptual point of view. For this reason, I have developed it in detail and illustrated it step by step with the help of CircuitLab.
The task
OP have set for themselves to reduce the 24 V input voltage twice with the purpose to obtain 12 V.
The OP solution
OP has inserted a "ballast" resistor R1 in series with the input source. A 12 V voltage drop appears across it, which is subtracted from the input voltage (24 V) and the desired 12 V output voltage remains.
The problem
Unfortunately, the load (thermostat) changes its resistance and therefore its current when it switches the heater. So the voltage drop across R1 and accordingly across the thermostat varies. Let's see it in CircuitLab.
Switch is OFF: As you can see, a voltage divider is formed by two equivalent resistors (R1 and Rt) in series, and the output voltage Vout is half of the input voltage Vin.

Switch is ON: Now, the heater Rh is connected in parallel to Rt. The equivalent resistance Rt||Rh is less than the initial Rt; so the current IL increases. The voltage drop across R1 increases as well and the output voltage Vout decreases.
From another viewpoint, the bottom voltage divider resistor (Rt||Rh) decreases. The voltage drop across it (Vout) accordingly decreases and the current increases.

simulate this circuit – Schematic created using CircuitLab
Basic idea
The voltage drop VR1 = R1.IL varies because IL varies but R1 is constant. How do we do it constant? Of course, by varying R1 in the opposite direction. So the basic idea is:
To keep the voltage drop across a resistor constant when the current varies, change the resistance in the opposite direction. As a result, their product will remain constant.
Expressed through the voltage divider point of view, it is:
To keep the voltage divider output voltage constant when its bottom resistance varies, change its top resistance in the same direction. As a result, its transfer ratio and accordingly, the output voltage will remain constant.
Implementation
Externally-controlled resistance
The simplest and most obvious idea that occurs to us is to switch the resistor R1 simultaneously with switching the heater. We can see this idea in many life situations where, in order to keep some (output) quantity constant when we change an input quantity, we simultaneously change another input quantity.
Straightforward solution. At first glance, we need another switch TSW2 that works the same way as TSW1 (or one DPST switch).
Switches are OFF: As above, the resistors R1 and Rt form a voltage divider with a ratio of 0.5.

simulate this circuit
Switches are ON: The difference with the above cases is that now an additional resistor R2 is connected in parallel to R1; so R1||R2 < R1. Or, in other words, a second divider R2-Rh is connected in parallel to the first R1-Rt.

simulate this circuit
Inventive solution. If we are observant enough, we can see that the two voltage dividers above form a balanced bridge circuit. There is no voltage difference between their outputs and, accordingly, no current flows. So it does not matter if there is a connection ("bridge") between them or not. Then let's remove it (of course if this is possible).
Switch is OFF: As above, R2 is not connected to R1 (the voltage divider R2-Rh is not connected in parallel to the R1-Rt voltage divider).

simulate this circuit
Switch is ON: Now as though R2 is connected in parallel to R1; so R1||R2 < R1. R2-Rh voltage divider is connected in parallel to the R1-Rt voltage divider.

simulate this circuit
Self-controlled resistance
There are some interesting resistors that have the property of changing their resistance when the current through or the voltage across them changes. They call them by the boring name "non-linear resistors" but I prefer to call them with the more meaningful "dynamic resistors".
Conceptual solution. The best way to understand how they act is to play their role; CircuitLab can help us do it. Just open the R1 parameters window and change its resistance like a 12 V voltage-stabilizing resistor.
Switch is OFF: In this case, adjust R1 = 600 ohm...

simulate this circuit
Switch is ON: ... and now, adjust R1 = 120 ohm.

simulate this circuit
Diode implementation. In electronics, (Zener) diodes behave such as dynamic resistors keeping up a constant voltage drop across themselves; they called them "shunt voltage stabilizers". When connected in series (our case), they "shift" voltage variations, and when connected in parallel, they fix the voltage variations. In the two circuits below, I have used an "ideal" forward-biased diode with 12 V forward voltage to mimic a 12 V backward-biased Zener diode.
Switch is OFF: As we can see, the diode behaves like us above - it adjusts its (static) resistance equal to 600 ohm...

simulate this circuit
Switch is ON: ... and now equal to 120 ohm.

simulate this circuit
Negative feedback
The disadvantage of all these solutions above is that they "blindly" compensate for only one disturbance - the change of Rh; but, for example, they will not react to the change of the input voltage.
The universal and most perfect principle we use to maintain a quantity in life is the negative feedback principle. Its idea is to keep Vout = const by subtracting it from a constant reference (voltage) and changing Vout until there is zero difference. In this way, all kinds of disturbances are compensated. Then let's use it here to maintain a constant voltage of 12 V across the load (not across R1).
Conceptual solution. To implement it, we connect Vout contrary in series to Vref and measure the result of comparison (subtraction) by a null indicator (voltmeter) Vdif.
Switch is OFF: We see that Vout = Vref (Vdif = 0) when we reach R1 = 600 ohm...

simulate this circuit
Switch is ON: ... and when we reach R1 = 120 ohm.

simulate this circuit
BJT implementation. Here a BJT transistor act as a varying "resistor" R1.
Switch is OFF: The BJT behaves like as above - it adjusts its (static) collector-emitter resistance equal to 600 ohm...

simulate this circuit
Switch is ON: ... and now equal to 120 ohm.

simulate this circuit
Op-amp implementation. To make the comparison more precise, an op-amp follower can be added.
Switch is OFF: The op-amp makes the transistor adjust its (static) collector-emitter resistance equal to 600 ohm...

simulate this circuit
Switch is ON: ... and now equal to 120 ohm.

simulate this circuit
Voltage-stabilizer implementation. The op-amp, transistor and other elements are housed in the 7812 voltage stabilizer.
Switch is OFF: It makes the same - adjusts its (static) resistance between the input and output equal to 600 ohm...

simulate this circuit
Switch is ON: ... and now equal to 120 ohm.

simulate this circuit