Fix PowerShell 504 Gateway Timeout When Calling REST API - How to Resolve Token Expired in Scheduled Tasks-Fix 'Remote Desktop Reset Settings Permission Denied' Error

Final checklist
- Confirm that the same symptom is gone after a restart or refresh.
- Keep the smallest working change and undo temporary diagnostic settings.