David Kimura PRO said about 3 years ago on Like Relationships and Global ID :
  It looks like we have a bit of mixed up logic here because the post.to_sgid that you're calling is the actual post, not the users_post record.

So, in your destroy action, you would need to have something like this below. This is happening likely because you're on a index action (where you're listing out all of the liked posts) instead of the show action for a particular post like in the episode.

def destroy
  post = Post.friendly.find(params[:post_id])
  user_post = UserPost.find_by(post: post, user: current_user)
  redirect_to post_path(post), alert: "unfollow"  

In this scenario, you're not really doing anything with the signed global id as it's not referring to the actual UserPost.