Local variable name in setup_postdata()

As noted in the documentation for setup_postdata():

setup_postdata() does not assign the global $post variable so it’s important that you do this yourself. Failure to do so will cause problems with any hooks that use any of the above globals in conjunction with the $post global, as they will refer to separate entities.

So the reason $my_post doesn’t work is that functions you are using are depending on a variable named $post, but it is not defined. setup_postdata() does not set this variable. You need to do this yourself by defining $post, which should be global $post.