I suspect the problem is not in the .htaccess at all, but rather somewhere in the PHP code or usage. Is it possible what’s being printed moves around a whole lot so the ‘369451’ that referenced it once is not quite right any more only a bit later?
The “flags” in .htaccess can be confusing because they’re so highly abbreviated yet don’t all follow the exact same pattern. [N] is “next”, [C] is “chain”, [NC] is “no case” (i.e. ignore the case of each letter when making this test), etc. Next and Chain together would be [N,C].