YUL has pre-clearance, so wouldn't a YUL-MIA-BCN itinerary work the same way as (say) a CHS-MIA-BCN itinerary?
If so, you would not see your luggage at MIA in any case. It, and you, would be forwarded to BCN as soon as possible. Yes, that might mean you get to BCN as scheduled and your bag doesn't, or vice-versa.
Or am I missing something?