This isn't automatically illegal. The fact that you took FMLA/maternity leave does not prevent your employer from laying you off. Instead, you would need to show that the company picked you out to be laid off because of your FMLA leave or pregnancy.
When you returned, did your employer restore you to an equivalent position? Are there indications that you were singled out to be laid off? What is the team restructuring that you are talking about? These are all questions that you need to work through with an employment lawyer.