The title is really the question but I will elaborate with some background and examples.
I have lately seen a number of answers (on ELL mostly) which state that something is ungrammatical because its meaning doesn't make sense (I'm paraphrasing). An example of which I of course can't find right now (will edit if I do).
I know of the famous sentence by Chomsky "Colorless green ideas sleep furiously." which seems to strictly answer my question in the negative but I think there is a bit of an issue here. That sentence is nonsensical in a very obvious way and moreover has an easy structure.
The reason I feel there might be some merit to the semantics argument is because I think it affects "introspective grammaticality judgments" (so many names for things you can find on the wiki).
Consider the following two sentences taken from this post.
This would have been cause to doubt that divine favour has been bestowed on Romans.
and the proposed changed version
This would have been caused to doubt that divine favour has been bestowed on Romans.
The first time I thought of the second sentence I automatically judged it as ungrammatical. But consider the situation where we are talking about two AI algorithms handling some information casting doubt on whether the favour was bestowed, and the person who utters the sentence points to the algorithm which would be caused to doubt that vs. the other one which wouldn't be caused to doubt it. In that case the sentence seems fine to me.
This might be a bit of a contrived example, but if you just consider "[Something] has been caused to doubt [something]" while knowing that the intent of the speaker was to really say "[something] has been cause to doubt [something]" I feel the original anchoring might make you judge it ungrammatical.
Is this a general effect or is it just me? Can semantics affect grammar?