Second get_permalink inside loop points to wrong URL

get_permalink doesn’t output anything, it returns the permalink. Your first call works because you use it within the_title, which echos its value along with any before and after parameters you pass to it.

Change your second instance to:

<?php echo get_permalink(); ?>

or use the_permalink, which echos the value instead of returning.

<?php the_permalink(); ?>

Many functions within WordPress follow this same pattern, get_ vs. the_, one returns for use within php, one prints to page.