Hello Sanaa Al-Tamimi,
If your server is enabled for automatic upgrade and a newer version is available, it performs an automatic upgrade to the newer version.
Check Automatic Upgrade Status:
Get-ADSyncAutoUpgrade
If the upgrade is disabled, you can enable it by running:
Set-ADSyncAutoUpgrade -Enabled $true
Run the Connectivity Test:
Test-MicrosoftEntraConnectHealthConnectivity -Role Sync
Download the upgraded version-:
Microsoft Entra Connect and Microsoft Entra Connect Health installation roadmap. - Microsoft Entra ID | Microsoft Learn
Register-AzureADConnectHealthSyncAgent -AttributeFiltering:$false -StagingMode:$false
Restart the server
If it still prompt, try upgrading the AADConnect,If you have any Staging server you can make that one primary and update the existing AADConnect version.
Ensure that TLS 1.2 is enabled on your server.