I could fix it. I think the problem was with the footage originally shot at 30fps. The compression of the file had something wrong. It was taken with a digital camera and maybe the compression used by default was a bit weird. I could fix it using Episode to reconvert everything to 30fps (even the original file that was shot at 30fps) and used h264 for both.
I replaced the footage in AE and no problem, everything worked perfectly.
Anyways, thanks for your advice! I thought maybe everything had to be at the same frame rate to render properly, but I guess it was one of the files that was not working fine.