That’s not really the right way to do it even though in practice you may not see any quality loss.
The correct way would be to render to uncompressed codecs. Example:
1. Transcode from H.264 to ProRes 4444 with 5DtoRGB. It’s preferable to export to 4:4:4 because we know we will be working with this footage in AE, which only works in RGB. You can get away with 4:2:2 if you don’t have the disk space.
2. Import into After Effects, do VFX. Export to uncompressed 4:2:2 to match the rest of your footage if it’s also 4:2:2.
3. Export the final program to uncompressed 4:2:2. You can then color correct this or use it as a source for HDCAM SR output, Blu-ray or DVD.
Some will say this is overkill, and perhaps it is considering your final delivery. However, if you are worried about generation loss, the only way to avoid it is to render to lossless codecs.
And yes, uncompressed 4:2:2 is technically lossy because it discards chroma info, but this type of “compression” does not produce the type of DCT / blocky compression artifacts you are probably worried about.