Adjust layout most recent post, taking pagination into account

$pcount is counting how many posts you’ve gone through in the current loop, it isn’t counting the number of pages.

Think for a moment about what the loop is doing, if you’re on page 2, why would you have the posts from page 1? It makes no sense, which is a sign that thinks aren’t going to work.

If what you have was ever going to work then this:

while (have_posts()) {
    the_post();
    the_title();
}

Would print out the title of all the posts on page 2, and page 1. This is not what happens. The main loop code would need to have some kind of hint as to what your intentions were which it doesn’t.

So your question is actually:

How do I determine the current page?

For which we can see an answer here:

https://stackoverflow.com/questions/1031442/finding-current-page-number-in-wordpress

Namely:

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;