Windows 11 22H2, error 0x00000709 when connecting a shared printer

When connecting a printer shared from another computer (Windows 10 22H2) in Windows 11 22H2, I received an error message with the code 0x00000709.

Unfortunately, the solutions described in the article below did not work
https://answers.microsoft.com/en-us/windows/forum/all/windows-11-error-message-0x00000709-while/c16a136d-a935-43a2-bbe1-9364a8d9379c?page=1

After many attempts, it turned out that the problem was in the way I was accessing the printer.

At first, I tried to install a shared printer using the computer’s IP address:

//192.168.0.100/nazwa-drukarki

but I was getting error 0x00000709.

Then I tried installing the printer using the computer name instead of its IP address:

//komp100/nazwa-drukarki

and this method worked, the printer installed correctly.