Post type of attachments switched…
Using a function to fetch an image out from the cache into media library with media_handle_sideload
and set_post_thumbnail
to feature the image in a custom post type. when using the plugin Post Type Switcher, the attachment file was saved under the post type of its parent post, not as post_type attachment