I was told (when I have asked questions to AACOMS about grade replacement). As long as the course descriptions are similar, Of course the credits must be the same or more. I asked about a BIO 111 class replacing a BIO 171 class from the same college. I had taken BIO 111 got a C+ then took BIO 171 got a C+ then took BIO 111 again and got an A. BIO 111 is general BIO for non-bio majors and BIO 171 is General BIO for Bio majors. I sent AACOMS the course descriptions and they said it was fine. They just need to be similar courses covering the same material.
Hope this helps you