I cannot apply the other user advice. I need my custom 404 page on the directory where I'm using CE.
Why are you accessing the 404 when calling a function in the editor? Can it be because a file is missing in your package?
Why don't you configure your website with a custom 404, test this bug and solve it?
Thanks.