The Bug
In 1.17 Release Candidate 1, creating a world with a datapack will most of the time crash the game, or sometimes give a crash report with a java.lang.ArrayIndexOutOfBoundsException. It may take multiple attempts to reproduce the bug.
How to Reproduce
Use the datapack
Type in the seed 1 using default world type
Load the world
The Error
It will most of the time softlock the game while generating the world, leaving a glitchy screen. Or the other hand, it will crash the game with a crash report, usually like this
[media]
Wrong Java version needs to be Java 16