Pre insert data when adding new custom post fire a json error

You should use content_save_pre filter. And maybe try some “simple” content first.

wp_insert_post_data is fired in a lot of situations 🙂 Even at deleting.