It makes no difference if you are a Freemason, or a murderer, or a thief, or an adulterer, or a sexually active homosexual etc.
The issue is not what particular type of mortal sin you have committed but whether you die with that mortal sin unrepented or not. If the mortal sin remains unrepented at death then you go to Hell.
Of course if a person does not know a particular sin they have committed is a sin of grave matter or even a sin at all then they have not committed a mortal sin. If someone did not know contraception was a sin of grave matter and they used condoms they would not have committed a mortal sin. If they are then informed that contraception is a sin of grave matter and they continue using condoms then they would be committing a mortal sin.
Likewise with a Catholic being a Freemason. If they really did not know that Catholics are not allowed to be Freemasons then they have not committed a mortal sin. However, as soon as they are informed that being a Freemason is a sin of grave matter they would immediately have to cease being a Freemason, go to Confession and repent. If they do not and continue to be a Freemason they would then be in a state of mortal sin and if they die unrepentant they would go to Hell.