Trouble with Loom 18b5 & Gradle 7.3

I’m an early user for Project Loom and I have a project to bridge it to the reactive world:

With Loom 18b5, one needs to have targetCompatibility set to 18 in build.gradle to be able to use the --enable-preview argument for the virtual thread API. If I do this, everything builds and tests nicely under Windows. (Gradle runs on JDK 11.0.13 and the executable properties are overridden to point to loom)

However, running the build on GitHub actions, it fails immediately with:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileJava'
Caused by: org.gradle.api.internal.tasks.properties.PropertyEvaluationException: 
   Error while evaluating property 'javaVersion' of task ':compileJava'
at org.gradle.api.internal.tasks.properties.InputParameterUtils.prepareInputParameterValue(InputParameterUtils.java:33)
Caused by: java.util.NoSuchElementException: No value present
at org.gradle.jvm.toolchain.internal.JavaToolchainQueryService.query(JavaToolchainQueryService.java:74)

(I have the same Loom 18b5 in a different project with targetCompatibility=17 and that project builds on GitHub Actions fine; it doesn’t use any preview api there.)

Please advise.