I don’t think H.264 in AVI is well-supported.
If space is the issue, I think you have a few options:
1. Render to ProRes 422 from After Effects. It’s high quality, and compresses about 5:1 vs. lossless. You can always compress to H.264 in an MP4 container later with Media Encoder.
2. Click the “Queue in AME” button in the render queue instead of the “Render” button. Ae 2020 can’t render directly to H.264/MP4, but Media Encoder can. Use one of the H.264 presets in Media Encoder.
2. Stay on After Effects 2020 and get the third-party plugin AfterCodecs, which will allow you to render to H.264 in an MP4 container directly from the Ae render queue.
3. Upgrade to the current release of After Effects (2023), which supports rendering directly to H.264/MP4 natively.