How to Fix OneDrive Sync Error 504 Gateway Timeout - Resolve 504 Gateway Timeout in Scheduled Tasks-Setup Windows Security Log Monitoring with Event Viewer

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