Valid flag for fchownat(2) is AT_SYMLINK_NOFOLLOW, not SYMLNK
The chown(2) man page contains this:
The fchownat() function sets the owner ID and group ID of the named file in the same manner as chown(). If, however, the path argument is relative, the path is resolved relative to the fildes argument rather than the current working directory. If the fildes argument has the special value AT_FDCWD, the path resolution reverts back to current working directory relative. If the flag argument is set to SYMLNK, the function behaves like lchown() with respect to symbolic links. If the path argument is absolute, the fildes argument is ignored. If the path argument is a null pointer, the function behaves like fchown().
SYMLNK is wrong. There is no such constant defined. It should be changed to
AT_SYMLINK_NOFOLLOW. See also https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchownat.html