Just an update. It appears as though I might have gotten a BAD WiFi shield unit.
I happened to run the code on a different set of parts, and THEN it always worked perfectly!
I replace only the WiFi shield within those parts, with the one I previously tried, and it gets issues again.
So, it looks like this wasn't a code problem. I'll see about getting a refund or replacement, soon, on this bad unit.

I replace only the WiFi shield within those parts, with the one I previously tried, and it gets issues again.
So, it looks like this wasn't a code problem. I'll see about getting a refund or replacement, soon, on this bad unit.