trying to add a author value in wp page links?

You check for <!--pageauthor:, but you expect it to start on the second character (1 === $has_part_title2) (you even have a typo there and left the 2 off). This will not work, because <!--pagetitle: is still part of that string (you don’t chop it off).

You should either chop it off (do a substring in $part_content2 = $pages[$i-1]), or allow it to appear later in the post (false !== $has_part_title2).

$has_part_title2 = strpos( $part_content2, '<!--pageauthor:' );
if( false !== $has_part_title2 ) {
    $end2 = strpos( $part_content2, '-->' );
    $title2 = trim( str_replace( '<!--pageauthor:', '', substr( $part_content2, 0, $end2 ) ) );
}