The problem had been resolved by changing the distribution URL to Gradle 7.6's distribution URL in the gradle.properties file.
gradle.properties