You don't need to use the variable I all. I don't use one. I just have the constant value for the Z Trigger Height parameter in my config_probe.g file.
If you want to use the variable then make the change you show to your config_probe.g file.
You don't need the full M558 line in your macros. If you just want to alter a parameter for speed or whatever you can just include that parameter. Since you've got a M558 P9 there it is expecting you to define the entire line now, but you're missing the pin name.
@icy_snake I show those opto endstops as currently unavailable, but there are other suppliers who make the same thing. Look for the LM393 comparator chip on whatever devices you use. That chip switches the output between logic 0 and 1 very quickly and I think that is responsible for the high precision of the endstops.