As described here
https://apple.stackexchange.com/questions/439540/how-to-restart-pinch-to-zoom-feature-via-terminal
Sometimes Quick Look Preview stops working too
killall Finder
should solve it.
can you add it as second option in the nice app you made?