In my attempt to debug the network issue i ran netstat -see on the ubuntu server before and after download test. Keep in mind that i don't actually know what they mean or how to fix them but this is the values that popped out:
TCPSackRecovery: 1107
TCPLostRetransmit: 927
Fast retransmits 4410
Retransmits in slow start 402
TCPTimeouts: 403
TCPLossProbes: 808
TCPSackRecoveryFail: 402
TCPSackMerged: 332
TCPSackShiftFallback: 1120
The entire network is virtual and there cannot be a problem of congestion so, again, it was a dead end. This morning i made a backup of the configuration and installed pfsense development version daily snapshot 2.7.0 from 06.01.2023 and.....it worked!
I still don't know the cause but i think i can run the development version until the stable one comes out.