The server-net API might only be available on preview versions of Minecraft as of right now
@Greymagic27 the crash can only occur when the command is run on a dimension, the add-on I am using in the video is only there to evaluate/run Javascript during run time for easier testing.
I have provided an alternate way to reproduce the crash & the addon you should use to do so.
YOOOOO they fixed the bug https://feedback.minecraft.net/hc/en-us/articles/29110275666957-Minecraft-1-21-20-Bedrock
I suppose you can mark this as resolved now.