Get Post ID from attachment ID (Redirect to product page)

It looks like the image (for which you’ve done a var_dump) is not attached to any post. If an image is attached to a post – the post’s ID would appear as 'post_parent', which in this case equals 0. This is often the case if you upload the image directly from withing media library (‘Media Library’ page in your WP admin) – you can still place such image into post content, use it as post thumbnails, in galleries etc., but this doesn’t mean that the image is attached to any post.

To properly attach an image to a post you have to upload it by clicking the ‘Add Media’ button when creating/editing the post. This is the only way that you can be certain that the image will be labelled as post’s attachment.