Yeah sounds just like a perfect "rule of law" that the atf could manipulate misquote abuse and defy in order to disarm the American people.
You're only supposed to be barred from owning a firearm if you've been declared by a judge to be legally incompetent. Medical records have absolutely nothing to do with this - it's a purely legal procedure that, of course involves doctors testifying and multiple doctors involved in getting the process even involved, but there is absolutely no basis for this in medical records. They're are essentially trying to rip into your private medical records to find everyone with a "mental illness related" diagnosis and use that to confiscate their guns.