Hello,
If the programatically way fails, you can try to run manually to see if any error appears during the input of data.
For example run:
Get-ADComputer <hostname> -Properties location | select -ExpandProperty location
then
Set-ADComputer <hostname> –Description “<manual input of location>”
--If the reply is helpful, please Upvote and Accept as answer--