I faced a very strange error in one of our integration environment where it started behaving weird on clicking of "page layout and site templates" /_layouts/15/AreaTemplateSettings.aspx
Server Error in '/' Application.
There are no page layout files available in the master page library of the top-level site. Add one or more page layouts to this library before you create a page or set page properties.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.SharePoint.SPException: There are no page layout files available in the master page library of the top-level site. Add one or more page layouts to this library before you create a page or set page properties.
Exception Details: Microsoft.SharePoint.SPException: There are no page layout files available in the master page library of the top-level site. Add one or more page layouts to this library before you create a page or set page properties.
In order to solve this issue just reactivate the site publishing feature again to reset the settings.