I thing the problem may be the post ID.
When creating a new post you’ll need to set up the “new_post” information that’s needed for creating a new post in the correct custom post type. When it’s an existing post you need to get the current post_id for the post being edited.