Well, yes, sort of. But not quite? I mean, when you're looking at examples of "grammatically incorrect" sentences in linguistics textbooks, sure you can do some fun mental exercises to find a situation in which it would be grammatically acceptable. But sometimes you can't. That's not because you're not being creative enough, it's simply that your understanding of the language makes you go "nope."
"The dog sits." Sounds good
*"Sits the dog." On it's own this would be ungrammatical. And if the textbook/professor is trying to explain how word order works in general it would remain marked as such. We could hypothetically argue that there's nothing wrong with saying "The man sits the dog." It's a little weird to my ears, and might be an example of a change in word use ("to sit something"?) or a regional change from "to set", but it does agree with the way English grammar works.
But there's still the problem of "the man". He isn't in the context yet. Only by including him (which might be the next topic the book/professor covers) does the sentence become acceptable. In which case, the sentence could have been preceded by "What does the man do?" [He] sits the dog. When the language allows for it, and the context clarifies it, we can drop elements of a sentence in speech. This contextualization is not always discussed in example sentences because it can make the concepts being taught more confusing. In general the example sentences in books tend to be of the “I just walked into the room and heard this thing said without any context” type.
*"Sits dog the." Nope. I've reached the limit of my creativity here. How about you? This just grates on my ears. Now, if I put it in another language where the determiner follows the noun it would be fine, but we're discussing English grammar here so it's "wrong."
Now, “the rock is sleeping” was an example of semantic incorrectness, because ordinarily the word “rock” includes the quality of “does not sleep” because it is also part of “not alive” (my apologies, it’s been a while and I can’t remember the technical terms for this right now). Which, as I said, might depend on your view of reality since some belief systems do assign “aliveness” to rocks, which might also allow them the act of “sleeping”. It’s not so much a matter of being able to imagine a sleeping rock as it is defining the ontological nature of a rock as it is conveyed through word use.
So, yeah, creativity in language is a good thing. And most professors (well, good ones anyway) will probably enjoy occasional examples of how an “ungrammatical” word or sentence is, in fact, ok. If they’re linguistics professors they’re more likely to be interested in the way the language changes, or the context in which things can go from ungrammatical to grammatical. It’s like that story that gets passed around about the professor saying two positive words don’t make a sentence and someone responding “yeah, right”.
Now, my post? I was in a really giddy mood because I had just had a cup of hot chocolate that was close to 80% cocoa or better, after not having any chocolate for about 4 months. And the text book I was reading is copyright 2003. I would not be at all surprised if English has changed in ways that allow some of the examples to be more or less grammatical to our ears. As you said, that’s how language works.
I guess, the point of my long rambling is ‘Don’t hate on the teachers who are doing their best in a world were the rules can change faster than they can be shared.’ Language teachers tend to be prescriptive because they need to teach the rules well or you won’t be able to understand when they’re being bent or changed so don’t try to tell them rules don’t matter. Linguistics teachers tend to be descriptive but they don’t always have the time during the busy school year to review all the latest research but if you’re polite they might just enjoy the occasional ‘oh that’s grammatical if-’ in class (just don’t be offended if they nod and say ‘yes, but that’s more complex grammar than we’re discussing right now’).