Error trying to use NEWID in macros

I’m trying to create a macro to generate a valid French IBAN. But keep receiving error that NEWID is not recognized. “‘NEWID’ is undefined”

    {%- set country_code = "FR" -%}
    {%- set control_number = "76" -%}
    {%- set bank_code = ((FLOOR(RAND(CHECKSUM(NEWID())) * 90000) % 90000) + 10000) -%}
    {%- set branch_code = ((FLOOR(RAND(CHECKSUM(NEWID())) * 90000) % 90000) + 10000) -%}
    {%- set account_number = ((FLOOR(RAND(CHECKSUM(NEWID())) * 9000000000) % 9000000000) + 10000000000) -%}
    {%- set iban_without_check = bank_code|string ~ branch_code|string ~ account_number|string -%}
    {%- set iban = country_code ~ control_number ~ iban_without_check -%}
    {%- set check_digits = 98 - (iban_without_check ~ country_code ~ control_number)|int % 97 -%}
    {{ iban[:2] ~ (check_digits < 10) and "0" ~ check_digits|string or check_digits|string ~ iban[4:] }}
{% endmacro %}```