The filter “wp_insert_post_data” runs before the data is inserted into the database. When you create a new post, the ID is not set yet, it is set by the auto_increment field in the database.
You can use a filter or action later in the process like save_post.