I have changed the logic of the server 2's add-on process you included and add an additional search condition to output@server1. Also, delete all others. It seems it works like you want. see how it is? if there are any other issues do not hesitate to ask further pls.
RoutingProblem_Myway.spfx