Hello Sankar,
This does not seem to be a PowerShell issue to me. Please check if there are network issues or maintenance activities happening at midnight that could be causing the interruptions. Check with your network team to see if there are any scheduled activities during that time.
Also, connecting to more than 100 machines one by one might be causing resource limitations. Consider staggering the connections or using a different approach to manage the connections and see if the issue persists.