Cannot pass a read-only variable to a reference parameter Brush

I want to change the value of a parameter of a material.
The material is applied to a border in the HUD.

I am trying to get a dynamic instance to that material but I get this error.

Cannot pass a read-only variable to a reference parameter Brush

How to do it?
Thank you so much!!

This works: