The correct way to do it can be found in the release notes of Blender 4.1: https://developer.blender.org/docs/release_notes/4.1/rendering/#musgrave-texture

In contrast to the method in the mentioned video this works with any dimension and lacunarity.