Two loops by pre_get_post on same page

It will be good to know how you implement your code in header.php.

You can try to move some condition to not affect all query?

function my_pre_get_posts( $query ) {
    if ( is_admin() || ! $query->is_main_query() )
      return;

    if ( is_post_type_archive( 'propiedad' ) ) {

Becomes

function my_pre_get_posts( $query ) {
  if(!is_admin()){
      if ( is_post_type_archive( 'propiedad' ) ) {
         // all your code here
         if($query->is_main_query()){
             $query->set( 'posts_per_page', 4 );
         }
         else{
             $query->set( 'posts_per_page', -1 );
         }
      }
  }

But the method is not the best, it will affect all query for this archive page (sidebar, menu). You need more conditions, when you implement your code in header.php you can define a do_action('header_pre_get_post'). and call the right posts_per_page in the pre_get_posts.

Hope it gives you some hint.