You didnt specify you want to do it in windows 11 as well. The way you wrote it thought it was for other windows.
Regedit change works fine, maybe it's something with your specific build.
Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced.
and add the 32-bit keyword TaskbarSi with values 0 for small or 1 for medium or 2 for large. After you change the value you have to restart.
You can cross-check the image above with your image and see that setting 1 is used based on the icon spacing and size.
If the above doesn't work for you, it's something from your windows and maybe wait for another build in a few days/weeks. Cant tell with all the modifications and external programs people use, which one may cause the problems.
Since there is nothing else to add and tbh it's a bit of a pointless issue, I will close the thread with the hope this trick worked for you.
Best of luck.