Just to make everything clarified, I used the following:
Create a custom email template with programmable email feature turned on
Include an email module inside the template
Regardless of using variable or not it both works
In the beginning it's not working because I tried to create the module and use it in Drag N' Drop email template, I changed to Custom email template later on, and find it in the beginning it doesn't work, I was guessing maybe because I missed something out, so I created another new email with the same template (sometimes you need to publish or save it twice for Design Manager to work or clear the full cache of the page just to make sure), this time it works.
I did double check on your code and I do not see any reason why it will not work, I was guessing maybe personalized variable is not available in the beginning (At least in Drag N Drop, it seems like it doesn't work).
So I think it should be ok just need to double check or recreate a new email just to scratch other issue out?
This is my code for your reference:
<div style="background: skyblue; padding: 10px;">
<!-- This works -->
<h2>
My Test
</h2>
<h3>
{% set phone_number = contact.phone %}
<span style="color: blue;">{{ phone_number }}</span><br>
<span style="color: red;"> {{ phone_number|regex_replace("[^0-9]|\\s", "") }}</span>
</h3>
<a href="tel:{{ phone_number|regex_replace("[^0-9]|\\s", "") }}" target="_blank"> CALL: {{ phone_number }}</a><br>
<a href="https://wa.me/{{ phone_number|regex_replace("[^0-9]|\\s", "") }}" target="_blank"> WHATSAPP </a>
</div>
<div style="background: gray; padding: 10px;">
<h2>
This is your code
</h2>
<!-- This works -->
<h3>
{{ contact.phone }}<br>
{{ contact.phone|regex_replace("[^0-9]|\\s", "") }}
<br><br>
{{ contact.phone }}<br>
{{ contact.phone|regex_replace("[^0-9]|\\s", "") }}
</h3>
<!-- This Fails -->
Broker ONE<br>
<a href="tel:{{ contact.phone|regex_replace("[^0-9]|\\s", "") }}" target="_blank"> CALL: {{ contact.phone }}</a><br>
<a href="https://wa.me/{{ contact.phone|regex_replace("[^0-9]|\\s", "") }}" target="_blank"> WHATSAPP </a>
<br><br>
Broker TWO<br>
<a href="tel:{{ contact.phone|regex_replace("[^0-9]|\\s", "") }}" target="_blank"> CALL: {{ contact.phone }}</a><br>
<a href="https://wa.me/{{ contact.phone|regex_replace("[^0-9]|\\s", "") }}" target="_blank"> WHATSAPP </a>
</div>