I'm trying to have Ninjask learn Trick Room so I can pass it onto another Pokemon (I'm not dumb enough to give Ninjask Trick Room smh), but I want to do so without getting Polygon-Z. Would this work?
>If there are too many candidate moves that the baby can learn, they follow this precedent, with each new move overwriting previous ones: 1. Level 1 moves. 2. Moves that the child learns by level up, if both parents have them. 3. Any compatible TMs, HMs and move tutor moves known by the father. 4. Any egg moves known by the father.
Source
Thus, if the baby Pokemon can learn it via TM, and Ninjask is the father, then you can pass it on. This is a list of the Pokemon that can learn Trick Room by TM, should you need it.