Maybe Acrobat has not fully initialized and is not capable of opening a file at the point that this code is executing.
Why to you think you need to perform this action every time Acrobat is opened?
Like I wrote earlier, according to the reference files insertPages can't be
used from this context.
The root directory is not a safe path. From Acrobat JS API Reference:
Acrobat 6.0 introduced the concept of a
A path cannot point to a system critical folder, for example a root, windows or system directory. A path is also subject to other unspecified tests.
For many methods, the file name must have an extension appropriate to the type of data that is to be saved. Some methods may have a no-overwrite restriction. These additional restrictions are noted in the documentation.
Generally, when a path is judged to be not safe, a
NotAllowedError exception is thrown (see Error object) and the method fails"
You will also need to create a trusted function to use the 'insertPages' method.