I tried the javascript -solution from the link of previous post, but it didn't help me. But it did gave me a clue, where the error could be, and I think it's detached pages in publishing sites. I'm not 100 % sure if this works, but here goes:
In order to edit publishing site pages, I have to detach the page from page layout with Sharepoint Designer. The error seems to occur only when editing these kind of pages in browser, so after finishing editing with Designer, "Reattach" the page to the page layout. I'm not missing any functionalities and my custom forms are still there. If I have to modify the pages later, I could detach the page again and modify it.