I'm really baffled as to why $TextureRect didn't work for you, the core coding in godot is rock solid. Parsing exceptions just don't happen without a good reason.
Anyway, delighted you got it going. Hats off to you for implementing it.
Um, scaling. I'm genuinely not sure whether
scale *= scale_factor on the spatial would work. No, ignore me, I'm being stupid. You can't multiply a 3d basis by a 2d one, that's undefined as the basis matrices rows and columns don't match.
No, you'll have to settle with:
$TextureRect.rect_scale = Vector2(scale_factor, scale_factor)
scale_factor=1 is no change and you can go from there.