The first thing that comes to mind is that there are leading or trailing spaces in either the 'name' or 'newmanager' properties.
The second is that your Get-ADUser is depending on the "-ErrorAction STOP" to prevent the Set-ADUser from executing. Unfortunaely that won't happen. Because you're using the -Filter parameter the expected terminating error will never happen of the cmdlet doesn't find a match.
See if this helps:
$File = "C:\temp\dr.csv"
$theuser = Import-Csv -Path $File
foreach ($user in $theuser) {
$SamAccountName = $user.Name.Trim()
$manager = $user.newmanager.Trim()
Try {
$GADuser = Get-ADUser -Filter { SamAccountName -eq $SamAccountName }
if ($null -eq $GADuser){
Write-Error -Message "$SamAccountName does not exist."
}
else{
$GADuser | Set-ADUser -Manager $manager -ErrorAction Stop
}
}
catch {
Write-Error -Message "The manager '$manager' account for user '$SamAccountName' does not exist please check in Active Directory"
}
}
BTW, replacing the information in the exception with a generic "something bad happened" doesn't help you to understand what the problem is. :-)