Have a look at node-red-contrib-ramp-thermostat.
If that does not help, then provide an example of your flow and inputs, then we can give more advise.
[edit]
here is a simple comparison, it has a deadband so once it reaches set point it has to fall below dead band value to turn off, this is to stop any oscillation.
[{"id":"20c65ac1.91d14e","type":"inject","z":"57675e72.26a0d8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20.9","payloadType":"num","x":130,"y":480,"wires":[["f9f5ce00.7a0ed8"]]},{"id":"f9f5ce00.7a0ed8","type":"change","z":"57675e72.26a0d8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload >= $flowContext(\"setpoint\") ? \t1 \t: payload < $flowContext(\"setpoint\") - $flowContext(\"deadband\") ? \t0 ","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":480,"wires":[["cdd63e01.c0bf2"]]},{"id":"f4ce440d.f28448","type":"inject","z":"57675e72.26a0d8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20.7","payloadType":"num","x":120,"y":440,"wires":[["f9f5ce00.7a0ed8"]]},{"id":"9d934a44.69583","type":"inject","z":"57675e72.26a0d8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"21","payloadType":"num","x":110,"y":520,"wires":[["f9f5ce00.7a0ed8"]]},{"id":"5c062863.e01be8","type":"inject","z":"57675e72.26a0d8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"21.5","payloadType":"num","x":127.33332824707031,"y":558.6666870117188,"wires":[["f9f5ce00.7a0ed8"]]},{"id":"cdd63e01.c0bf2","type":"switch","z":"57675e72.26a0d8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"istype","v":"number","vt":"number"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":540,"wires":[["7fa11ff4.ea97b8"]]},{"id":"7fa11ff4.ea97b8","type":"rbe","z":"57675e72.26a0d8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":550,"y":540,"wires":[["3f5a851.f4bdffa"]]},{"id":"3f5a851.f4bdffa","type":"debug","z":"57675e72.26a0d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":600,"y":480,"wires":[]},{"id":"2ca75c14.eefb4c","type":"inject","z":"57675e72.26a0d8","name":"set set point","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"21","payloadType":"num","x":160,"y":360,"wires":[["da712b9f.7a0588"]]},{"id":"da712b9f.7a0588","type":"change","z":"57675e72.26a0d8","name":"","rules":[{"t":"set","p":"setpoint","pt":"flow","to":"21","tot":"num"},{"t":"set","p":"deadband","pt":"flow","to":"0.2","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":360,"wires":[[]]}]