The people of Brazil have every right to be disgusted by American swimmer Ryan Lochte and his ever-changing story of how he was “robbed” during the Rio Olympics.

(And nobody should be surprised by this: Anyone who watched his E! reality series What Would Ryan Lochte Do? can confirm that Ryan Lochte is a disgusting person.)

Yet this whole mess also feels like a classic case of, to use Abraham Lincoln’s words, “snatching defeat from the jaws of victory.” Brazil should have been completely in the right, yet they reminded us once again that they’re a nation ravaged by corruption.

It’s impressive that Rio police unraveled Lochte’s story so quickly, especially considering how much they struggle with solving actual crimes. In 2011, it was reported that the state of Rio had over 60,000 unsolved murders in just a decade: in 24,000 of the cases, they failed even to identify the victim.

While Lochte and his fellow Olympians may be liars and drunken vandals—and it should be noted we haven’t seen any actual proof of vandalism yet—we have also witnessed the following:

  1. Video of four unarmed people being held at gunpoint.
  1. Police insisting that these unarmed men “voluntarily” handed over money to people with guns.
  1. Two people, who were not charged at any point, being dragged off a plane.
  1. The other two people being barred from leaving the country indefinitely.
  1. One of the two people who potentially was facing criminal charges making everything instantly go away with a donation of roughly $11,000.

It’s impressive that Rio police unraveled Lochte’s story so quickly, especially considering how much they struggle with solving actual crimes. In 2011, it was reported that the state of Rio had over 60,000 unsolved murders in just a decade: in 24,000 of the cases, they failed even to identify the victim. Rio’s detective work was pretty consistent with Brazil as a whole, solving just 8 percent of murders nationwide. (During that time period, the U.S. and Europe generally averaged 70-plus percent.)

And since 2011, crime in Brazil has arguably gotten worse, with recent notorious incidents in Rio including the robbery at gunpoint of an Australian Paralympian and body parts washing up near the beach volleyball site.

Even assuming everything the Brazilian police assert is completely true, it’s still troubling that in a nation whose people face so many real dangers, the authorities dropped everything to focus on destroying the credibility of foreign visitors as quickly as possible, all to ensure the protection of Rio’s image, rather than Rio itself.

Then again, image has recently taken precedence over reality in Brazil. This is a nation whose president has been impeached largely because 60 percent of its congress has faced or is currently facing criminal charges for matters ranging from bribery and electoral fraud to kidnapping and murder—and wanted to distract the nation from their own legal problems.

Were I a tourist who got robbed in Brazil—and I mean legitimately robbed, not whatever Lochte experienced—I would think long and hard before I reported the crime to the police and risked getting stranded in Brazil until they saw fit to let me go again. After all, I’m not a gold medalist with the U.S. Olympic Committee working to get me back to America as quickly as possible.

I should note that I’ve visited Brazil before and loved it: I very much hope to return at some point to the country, including to Rio. But there are a lot of other places I’d like to visit as well. I do not deny for an instant that Lochte and his teammates are probably dirtbags, but the fixation on them overlooks much deeper problems in Brazil, ones that make me think perhaps Ecuador would be a better place to visit—and be allowed to go home again.