There is a difference in an ex parte hearing like a red flag law (the subject doesn't know about it or get to be present) and a regular hearing that you get to present your side. If you have had a chance to present your case to the judge about why you are not a danger to others and they still rule that you are, then you should lose the guns for a set amount of time. That being said you should be able to appeal. It should definitely not be permanent barring a violent felony conviction. It's too easy to screw someone over permanently, in a single hearing, to make it a forever ban.