Yes. If
Gomazoa has left the battlefield before its ability resolves, the ability will attempt to put Gomazoa on top of its owner's library (and fail because Gomazoa isn't where it's expected to be), and then that player will shuffle his or her library.