Hi tarik,
I'm glad to hear you solve the problem and thanks for your sharing.
By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others.". So, I would make a brief summary of this thread.
You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community members to see the useful information when reading this thread. Thanks for your understanding!
[This page has encountered a critical error. If this problem persists, contact your system administrator.]
Issue Symptom:
After enabled anonymous access, the SharePoint site encounters a critical error with the message: "This page encountered a critical error. If this problem persists, contact your system administrator."
Even if disabled anonymous access to troubleshoot, the error persists.
Current status:
1.Install updates for your SharePoint.
2.Take a backup of your web.config.
3.Enabled anonymous access
4.Disable it.
5.Change back the web.config
Test at every step if it works or not, if it doesn't work then remove the following line from web.config:
<PageParserPath VirtualPath="/searchadministration.aspx" CompilationMode="Always" AllowServerSideScript="true" />