Wait longer for middlewared to start
Freenas gets stuck if copying large files and resets the connection after approximately 4GB. The LAN connection isn't the problem. I have transferred a 11GB file via wget in the freenas-shell without problems. The client used is a windows 10 pc. I tried it with smbv1 and smbv2. The outcome was always the bug.
In copied ticket middlewared takes too long to start (likely slow USB boot device) so it does not setup so boot proceeds without it running, leaving system without swap.