I got it sorted out.
This code is inside a Custom Event, there is a Cust. Event that called before that which I showed in the images above, I just changed the order they are called (Before, another custom event was called and then that code was rotated, I reversed the order and the code of the above images is called before and The value exits correctly)
This additional Custom event that I said does not have any code that fiddles with the variables of the “CalcularAtributos” Event but it has influenced the code in some way.
I think it’s a bug, but I have no idea why.