There is no problem in your code or no bug with QGIS. createRenderer method is deprecated since v3.10. Therefore, there may be incompatibility between the method and later versions of QGIS. I recommend you use the constructor.
You may set different labels for different scale ranges. E.g. pink labels for 1:1000 to 1:10000, red labels for 1:10001 to 1:25000.
You may set a scale dependent visibility for all of you labels. E.g. no labels are visibile above 1:25000.