Update Modified date when scheduled posts get published

With the help of someone else, I managed to figure this out.

Add this to your functions.php:

// Scheduled posts should update modified date when published
function update_modified_date_to_post_date( $post ) {
    $updated_data = [
        'ID'                => $post->ID,
        'post_modified'     => $post->post_date,
        'post_modified_gmt' => $post->post_date_gmt
    ];
    wp_update_post( $updated_data );
}
add_action( 'future_to_publish', 'update_modified_date_to_post_date', 10, 1 );