The error occurs whenever I save a file called _mainhome.php.
_mainhome.php is a page used as a route FROM Home.php.
They are both in the same directory (/layouts/mainpages/), though they used to be in different directories.
MORE INFO:
The only place Home.php is referenced inside _mainhome.php is here: <!-- Wappler include head-page="layouts/mainpages/Home.php" appConnect="local" is="dmx-app"...
Routes.json has the correct path for Home.php
.htaccess has the correct path for Home.php as well.
So you moved one of these pages and didn't change the path in the comment? This is surely causing the issue as the file cannot be found in the wrong path.
You can't just move files around different folders without fixing the paths.