The query you posted does not have any syntax error, but it dies with a conversion error, since the backupset table has the lsn:s as numeric(25,0).
I will have to admit that I did not know the answer myself, but as I found that a bit embarrassing, I went to Google. I found a post by the late Robert Davis, which seems to explain how to do the conversion: https://www.sqlservercentral.com/blogs/day-11-of-31-days-of-disaster-converting-lsn-formats