Run the following commands for Linux. These will need to be adapted for other OSes.
$ rm -rf ~/.gradle/caches/fabric-loom/
$ ./gradlew --refresh-dependencies build
This seems to force Loom to do the decompilation process again which fixes the issue.