Ensure build trace ignores apply correctly when nested (#42606)
x-ref: [slack
thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1667821787658109?thread_ts=1667480066.387989&cid=C03S8ED1DKM)
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`