[agent] Fix post prepare network changes [fixes #52275897]