Michael Alan Chance Green, who worked on a ranch as a cowboy, was obsessed with professional wrestler and entertainer Terry Funk. He believed he had to warn him of imminent danger and delivered bizarre handwritten letters to Mr. Funk’s mailbox, until he was charged with stalking.

A Texas judge hearing the case declared Mr. Green mentally incompetent and committed him to a state hospital.

More than a decade later, in 2016, Mr. Green bought a single-shot rifle at a North Texas gun store. A mandatory federal background check failed to discover in time that he was barred from buying or owning a firearm because of his mental-health troubles.

When the mistake was revealed, a week too late, agents from the Bureau of Alcohol, Tobacco, Firearms and Explosives were dispatched to perform a job that was potentially dangerous and delicate—they had to seize his rifle.

Years of growing gun sales have overtaxed the federal background-check system. By law, the sale can proceed after three business days, whether or not the check is completed.