After I run this embedded query and click "Edit" in the new toolbar on the right, nothing happens and the menu seems to be broken (see the screenshot).
Since it's external query, the target server may know what foaf: is. And in any case, even if query syntax doesn't parse, it should not break the GUI.
The 404 may be separate problem, as I am seeing it on other queries too.
The problem is SPARQL.js tries to parse the query and then fails with the error when trying to resolve the prefix.
I am afraid we cannot do anything about it.
A workaround would be defining the prefix in the query or in the default prefixes ...