And is that the host that is causing the error message on the
$dts = get-view $_.ConfigManager.DateTimeSystem
line ?
If you don't have a debugger, you can show the name of the host on screen.
Just add the following line before the line above (inside the code block)
Write-Host $_.Name
I suspect the test succeeds because the script uses the value in $t from the previous host.