Yes, it happens. I tested positivo the day before my flight home April 27. I just had a mild scratchy throat for two days prior. I am vaxxed and boosted and often catch a cold in Europe. I had walked in cold wind and rain and slept in one very cold albergue. I wore my N95 mask regularly inside. This was wrong Pollyanna thinking on my part. I should have self tested immediately when I got the scratchy throat. But after walking for two weeks I was just feeling great. (Home test kits are 2.80 Euro at any pharmacia in Madrid. They are $22 in my home town.) When I got my crushing test results I booked an Airbnb studio apartment with kitchen facilities in Centro Madrid for $110 a day for 10 days and re$cheduled my flight home for 11 days later. Madrid health authorities very politely and nicely told me they could not issue a clearance for flight for 15 days after testing positivo but they did give me an EU vaccination certificate based on my CDC card. The US Embassy website suggested two US telemed health practitioners that could issue a clearance after 10 days. But the first one I checked said you had to be physically in the US to schedule an appointment. My daughter who lives in France scheduled me for a telemed conference with MobiDoc, a certified health practitioner based in Malta. But on morning 10 I self tested negativo and went to a certified lab (Life Length) in downtown Madrid and also tested negativo. Because I could not figure out how to cancel my appointment I still had a telemed conference with a doctor in Croatia who spoke better English than I do. I had prepaid the outrageous fee of 25 Euro. Just kidding. I THINK I have a pretty good travel health insurance policy. They said save all my receipts for my extra 10 days and I would be reimbursed for hotel, meals, taxis, medical expenses. We'll see.
I had always considered Madrid a huge, noisy, busy city to be transited through as quickly as possible. Wrong! I was allowed to walk anywhere outside masked up. It is a delightful, very walkable city. Toward the end of my unexpected marooned in Madrid adventure I had another surprise. My daughter took the train south and visited me the last couple of days (staying in a nearby hostel.) Buen Camino