Yes, definitely; in particular, I'm pretty sure it also affects queryDataIds. The root problem goes further back - it's in the definition of the Query before we call execute (which pretty much just blindly executes the SQL we've given it). That code is very complex, and I don't recommend trying to trace the problem all the way back through that, at least not directly. I think the way to debug it would be to see what kinds of query options (and database content) do and don't yield duplicates, but that's still a pretty big phase space to explore, and it's not something I'd recommend as part of what's supposed to be a quick ticket.
DM-21448is now in review; that adds hashability to DatasetRef, and hence may make this ticket even easier.