Typically in near all cases when this occurs, broker and agent have a '90' day protection period, if they brought a ready and willing buyer presented with a purchase agreement of offer of some type and seller doesn't pursue and then followed through or other deal that fell dry , ye protection clause ensures their commission and contracted amount. If you canceled purchase agreement AND listing contract short of timeframe this is pretty self explanatory why one would pay outside of contract that was 'cancelled'
But generally speaking above is right, generally, but depending on the specifics and details in the listing agreement and purchase this answer might be different. Feel free to call if you have questions on this in a general sense.. I would be happy to help also if you haven't reached your goal !6143520723