The writer maybe sees push open as a phrasal verb, like put on. Phrasal verbs can be used in two ways:
1) She put the dress on
2) She put on the dress.
Your sentence matches form 2). I cannot find any dictionary evidence to confirm that it is normal to use push open as a phrasal verb, but this NGram indicates that quite a few writers use this form.
Here are a couple of examples:
When you've finished putting beads on all the pins, open the big (#3) safety pin and use the nail file to push open the little loop-the-loop at the end of it My best friends and me
Silence promises danger not peace, for always the sounds that push open my door or your door, are remembered as coming out of nothing. In the shadow of sharpeville
While both of your examples are grammatically correct in a strict sense, the first is the far more applicable and natural formulation.
In a restrictive appositive phrase, the second noun or noun phrase modifies the first one, restricting or narrowing its sense. Consider a conversation:
My brother took a new job.
I thought you had two brothers. Which one?
My brother Jake.
Similarly,
The path appears to be incorrect.
What is the path?
The path 'C:\foo\bar'
There are situations where Jake my brother has a new job is idiomatic, but this formulation is not very common, as in most conversations, there will be more possible brothers than Jakes.
Jake took a new job.
Already? He's only been here a month.
I'm talking about Jake my brother, not Jake from Accounting.
A writer might employ such a formulation deliberately, to highlight a contrast or for antanaclasis:
The success of Donald Trump the brand far exceeds the success of Donald Trump the man.
Half a century later, he could speak of Vietnam the country and not Vietnam the war.
It's unlikely, however, that you are aiming for a literary effect in your error message. As 'C:\foo\bar' is not going to be anything other than a path, The 'C:\foo\bar' path appears to be incorrect sounds "backwards" to me and I would advise against it.
Best Answer
I think you've hit the nail on the head in the comments. (By the way, let's note that this discussion is entirely about the order of pairs of nouns. If one of the words is an adjective, there's no question the adjective comes first in English. In "the color red," "red" is a noun, but in "the red color," it's an adjective, just like "the red car.")
To help clarify, these constructions have a "category" and an "instance" of a thing in that category. So in "the movie Titanic," the category is "movie" and the instance is "Titanic." Similarly, "variable" is the category and "foo" is the instance.
I think you've hit on the answer: what makes the difference is the degree to which the "instance" can work as an identifier on its own—a name, a title, a proper or "proper-ish" noun. Could you leave the "category" word out of your sentence and still be understood? If so, the category should probably come first. "Let's watch the movie Titanic" could equate to "Let's watch Titanic," with little need even to establish the context of movies. As the answer about Die Hard shows, when the instance really is a true proper noun (a unique title, etc.), putting the category second changes the meaning (making the instance work like an adjective).
Many of your examples could go either way, but the order could give a slight alteration in emphasis. For "file extension" and ".jpg," I might put the category first if the emphasis was on jpg: "Filter for the file extensions '.jpg' and '.png.'" But the reverse if the emphasis is on "file extension": "Don't confuse the 'jpg' folder with the 'jpg' file extension." Similarly, say I have a script named "setup." If I say, out loud, "Run the setup script," I could be using "setup" as an adjective and the script might actually be named "init_setup." But if I say "Run the script 'setup,'" I'm clearly using its name.