This is most likely a configuration or compiler problem on your system (the error is not in any way related to the grid refinement example and example compilation is validated for many different configurations in our CI).
Can you share your configuration and environment details?