get_posts post title permalink not working for last item in array

You should use a foreach loop instead, as the count index isn’t the best way to walk over an array.

<?php
$speakerarray = get_post_meta($post->ID, 'cpt_food', true);
foreach($speakerarray as $foodname) :
    $posts = get_posts(array('name' => $foodname, 'post_type' => 'food'));
    $post = $posts[0];
    echo '<a href="' . get_permalink( $post->ID ) . '>' . $foodname . '</a><br>';
endforeach;
?>

I used a online tool for unserialize your data and it returned an error ?