If you are using ACF fields values to generate your value then you need to us the acf/save_post action instead of wp_insert_post_data. ACF does not save fields until after your filter runs so you are seeing the old values of any fields and not any changes. https://www.advancedcustomfields.com/resources/acf-save_post/
If you want to use the hook you’re using then you need to look in $_POST[‘acf’] to get the new values. This is covered on the above page as well.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users