Nodes like the Attribute Color Ramp node would usually output a color. However, if the result attribute exists already and is e.g. of type Float, we want that the attribute remains of type float.
Currently the attribute is first removed and then recreated with a new type.
This makes the type of an attribute more consistent, because nodes usually do not change the type of attributes, unless they are explicitly asked to do so. Furthermore, this allows us to use the same attribute as input and output in a node more often. (e.g. in the Attribute Color Ramp node, the input and output attribute could be the same)