The issue has to do with AE’s render pipeline (rendering order). In a normal state, masks are rendered first, followed by effects and then transforms.
In your case, masking before the text effect essentially does nothing other thn masking on an empty solid which is then affected by the effect. In short, what you need to do is to have the text applied first, in one comp, and then apply the mask, in another comp. The nesting procedure ‘forces’ AE to process the text effect first and then the mask.
TIme to upgrade your AE skills by reading a book or two.
HTH
Roland Kahlenberg
https://www.broadcastGEMs.com
https://www.myspace.com/rorkrgbspace