Change query variable for wordpress search

The code you found works not by changing the query variable but by converting another variable into the s variable that WordPress expects.

If you look at the WP_Query object, that s parameter is pretty deeply embedded into Core functionality.

The simple solution, and perhaps the only one, is to choose some other parameter for your purpose rather than attempt to hijack one that is hard-coded into fundamental Core WordPress code.