I solved my problem by adding the following line in the variable declaration block of the duplicate post function.
$flexible_content = get_field('YOUR_FLEXIBLE_CONTENT_FIELD', $post_id, false);
And then the following lines in the if ($post)
condition block.
if ($flexible_content) {
update_field('YOUR_FLEXIBLE_CONTENT_FIELD', $flexible_content, $new_post_id);
}