Not automatically by federal law because there has not been adjudication, a legal proceeding.
But adding them via court is a very strong possibility.
If someone is receiving government money because they are considered to have a mental illness so severe that it reduces normal functioning, then making a case against them being a prohibited person that shouldn't have a gun is almost a slam dunk. That very clearly says "mental defective" under the law and just needs to go to court for it to be declared and become official.
Too extensive of a legal defense that they are not "mentally defective" brings up the question of fraud if they claim not to have the severity of illness they receive money for.
So it means at any time a court could strip the right away at a moment's notice because the case against them already exists and would just need to be acted upon.
Some states under state law are also more restrictive than federal law. So someone could also be considered a prohibited person by a state and not yet meeting the definition of prohibited federally.
For example I know that in California if you are given a 72 hold 5150/Baker Act type of evaluation you are automatically a prohibited person for 5 years.
This can result from nothing more than the declaration of a peace officer (LEO.)
Cops even sometimes take intoxicated individuals to such places just to sober up, especially if they are not guilty of any crime for which they could actually lock them up for. If the police arrived at a home for example where it was legal to be intoxicated, and they wished to arrest someone who had broken no law or if they wished to separate individuals, they may use a psychiatric hold to do so.
So just being drunk could result in a 5 year state level prohibition.
No crime, no adjudication, no court hearing required.
Possessing a firearm after would then be a prohibited person in possession, a state felony, which would then prohibit them for life in the nation.
Lifetime prohibition is only slightly more involved. If someone is brought in on such a temp evaluation and they decide to hold the individual over 72 hours against their will that can be a lifetime prohibition.
Better hope business is not slow for that hospital or they are in danger of laying off employees. They might just decide they need more than 72 hours to evaluate.
The mental illness avenue is currently the easiest way to remove someone's "right" to firearms.
Many illnesses are themselves discretionary interpretations of the severity of a perceived character defect.
If someone is or has actually been treated for something then it becomes easier to make a case that they suddenly need more treatment, as they have a mental illness record, even though they have broken no laws. That of course can remove firearm rights.
If the issue is considered so severe by the individual as to disable them and require financial assistance, a court of law can say that means any number of things in the future. That the individual needs whatever treatment they declare, or that they are unfit to have or do A B or C.
It would be like a case where the defendant pleads guilty to everything, it is their own actions that say they have a severe problem, in this case pursuing and collecting money for a severe mental illness.
If they claim to not have the problem they sought payment for disability for, they can then be tried for fraud for collecting the money.