It would appear that the problem is solved if I add only following steps into preinstall script
disable network filter
stop network system extension
After that installd replaces the bundle and system extensions in it, postinstall then runs our helper, which registers system extenison and starts the network filter (starts TransparentProxy/AppProxy).
I guess stopping system extensions while the old bundle still exists, then replacing the bundle and upgrading system extension (basically it just registers new verison of the extension as the process is not running anymore) causes OS (launchd) to clear up XPC related caches.
Topic:
App & System Services
SubTopic:
Networking
Tags: