Solution for my case: Installed Gradle JDK jbr-21.
Go to Settings -> Build, Execution, Deployment -> Build Tools -> Gradle. In Gradle JDK, I selected jbr-21 as shown in the screenshot.
I found on the internet that Android Studio generally supports JDK 8, JDK 11, and JDK 17, depending on the version of the Android Gradle Plugin and Android Studio.
My JAVA_HOME was set to Java 23, which might have been the issue. After selecting the JDK via Android Studio (this specific version), I successfully ran the Android emulator.
Note: My Gradle version is 8.7.