You're combining a query with a set operation which has never been possible in API (and if it was, I'm curious which version..).
This is documented here:
https://wiki.mikrotik.com/wiki/Manual:API#Queries
print command accepts query words that limit set of returned sentences.
The API conversation should be:
/ip/route/print
?dst-address=0.0.0.0/0
!re=.id=*1=dst-address=0.0.0.0/0=gateway=192.168.5.2=gateway-status=192.168.5.2 unreachable=distance=1=scope=30=target-scope=10=active=false=static=true=disabled=false
!done
Then you should update the item based on .id:
/ip/route/set
=.id=*1
=gateway=192.168.5.1
!done
And it will update successfully:
/ip/route/print
?dst-address=0.0.0.0/0
!re=.id=*1=dst-address=0.0.0.0/0=gateway=192.168.5.1=gateway-status=192.168.5.1 unreachable=distance=1=scope=30=target-scope=10=active=false=static=true=disabled=false
!done