set new link as permalink

I would think something is wrong here:

$meta = get_post_meta( $post->ID, $extlink , TRUE );

This is the function:

get_post_meta( int $post_id, string $key = ”, bool $single = false )

You are setting the $extlink as the $key parameter, but it is really a meta key? From your explanation, it seems to be a value of the bookzone key …

If the above makes sense, then inside your function, fix the following:

$meta = get_post_meta( $post->ID, 'bookzone', TRUE );

As Pat J said, also remove the add_filter and the function itself outside the while loop. When you set this particular filter once, WordPress will execute your filter’s function whenever the permalink is called inside the WordPress loop.