How to copy library source code from other Git repo to an Android Gradle application GitLab build process?
What you need is not to checkout both projects side by side, but to add the library as a Git submodule in your application repository.
Then set up GitLab CI to checkout submodules before build.
This will not only make your CI work, but as an added benefit each commit from application repository will reference a specific commit from library repository, so  nobody will have to remember what commit to checkout in library repository to ensure the application builds correctly.
Edit:
To be clear, I'm not saying that composite builds (which is a proper name for your setup) are always bad, but I believe that they should be used for optional dependencies (like JetBrains did in their kotlin-native repository) or when developers need need to have an option of replacing dependency norally pulled from some Maven repository with locally build version (eg. to test if their app works with some changes in the library before submitting pull/merge request for the library) and not for everyday use.