It has nothing to do with PSCustomObject. The statement "$table" is sent to stream 1 (the "Success" stream). Write-Host is sending the output directly to the host. If you want them written in the order you expect, use Write-Output instead of Write-Host.
understanding-streams-redirection-and-write-host-in-powershell