The trustee likely did not seek to dismiss the Chapter 7 due to your being told you could keep the tax refund, but rather because you didn't disclose the refund on your bankruptcy schedules.
If so, then the dismissal is legal, unless the trustee expressly induced you to violate the law to begin with by telling you that you did not have to report the refund amount.
If you had a lawyer or other person tell you that you did not have to report the refund, then you could sue that person for negligence. If that person was a nonlawyer, you could also report them to the county district attorney for prosection on a charge of unauthorized practice of law.
Re losing your house, it would be more likely for that to occur in a Chapter 7 than 13, so I don't know how you are connecting the dots on this issue. You would have to provide more info about the situation, for any sort of an analysis.
Hope this helps.
Terms and Conditions: By your continuing in this conversation with me, or by your clicking “Accept”, you are expressly agreeing to all of the following: (1) our communication is for entertainment purposes only; (2) you are not consulting me in my professional capacity as an attorney; (3) you do not seek to establish an attorney-client relationship with me, nor do I with you; (4) you will not rely on anything I say and you will obtain appropriate legal counsel via a traditional/office consultation with an attorney licensed to practice in the jurisdiction where your legal issue arises (and you may not use our communication to avoid taxpayer penalties imposed by the U.S. Dept. of Treasury); (5) by communicating with me in this public forum you are irrevocably waiving any right to privacy, confidentiality and attorney-client privilege concerning the matters discussed. You further separately declare that any payment made by you is not consideration for this contract, nor offered for any services rendered by me on your behalf, but rather is made in genuine admiration and respect for my desire to help others. If you do not agree with these terms and conditions, then you must advise me immediately.