I'm using Barracuda and yolov5,too. I faced the problem like you(the onnx model can't be recognized by unity).
And I solve this problem by your export_unity_onnx.py..
But I want to know why.
It seem like you use Tenssort, but i can't understand the inside logic.
Can you help me.