Package auxhook provides hooks for writing at the begin of .aux files. The typical usage case is providing command definitions (\providecommand) to disable commands, when the package, that defines the command, is no longer loaded. Therefore package auxhook needs access to the point right after opening the .aux files for writing. The main .aux file is opened in \begin{document}, therefore it tries to patch it. If the patching fails, because \document is changed by a class, package, newer LaTeX version or whatever, then it uses the official hook \AtBeginDocument. Depending on the used class and packages it might be a little too late. Therefore a warning is given. Probably the warning can be ignored in many or most cases. If you want clarity, then a minimal document for analysis is needed.