What is the grammar behind "上去“ in 听上去不错?
上去 here functions as preposition (to),  in this case, the object 'words' is omitted

听 (listen) + 上去 (to) 


(听上去)不错 = "It is not bad (listen to it)."


Example of other [verb +上去] phrases


看上去 (look at it)
摸上去 (touch on it)


You can use 起来 instead of 上去 in this sentence
- (听起来)不错 = "It is not bad (listening to) it. "