I would like to share the solution to my problem described in the previous comment.
The issue is that I defined the set of outputs of the model as a “set” as follows:
outputs = {'output1', 'output2', 'output3'}
mod, params = relay.frontend.from_tensorflow(graph_def, layout=layout, outputs=outputs, shape=shape_dict)
This results in a random order of the outputs when the set is indexed. I used this code as I found it as a example to define the outputs, however, the right way is with a list as follows:
outputs = ['output1', 'output2', 'output3']
mod, params = relay.frontend.from_tensorflow(graph_def, layout=layout, outputs=outputs, shape=shape_dict)
Small difference but it is important to be aware of this