Can't open an afp network share (but other machines can)
OK, it looks like I have found the answer. It's a problem in Finder.

Finder apparently doesn't understand that 192.168.1.1/Data and 192.168.1.1/TimeMachine, despite they are advertised separately under AFP that require different credentials, are two different shares.

If I connect to 192.168.1.1/Data, provide correct username and password, and browse that share, everything works. If I then connect to 192.168.1.1/TimeMachine, instead of asking for the credentials to access that share, it tries to reuse the credentials from the previous share. That obviously fails.

Unfortunately the KeyChain is also not able to distinguish between the two so you can't just save both sets of credentials there.

The solution is to create a mount script that logs in to 192.168.1.1/TimeMachine and mounts it directly after a reboot (before much else is done on the machine). Then reboot, go to the Time Machine settings, and point to this share as a network volume for TimeMachine. TimeMachine network drives do get their own key in KeyChain so you can have TM settings store the correct credentials in the KeyChain.