There are a number of words that seem to be accented on the last syllable when they are used predicatively, or as the last word in a phrase, but not when attached somewhere before a noun in a noun phrase.
I'm not sure exactly what the nature of this is, but I agree with Araucaria that it is a prosodic phenomenon, and that it involves words that have more than one stressed syllable to begin with. So I definitely would not say that "up‵set and ‵upset are distinct lexical items".
I don't think it can entirely be attributed to stress shift to avoid stress "clashes" when the following word starts with a stressed syllable, because something like this can happen when the following word doesn't start with a stressed syllable.
For example, I don't hear or feel like there should be an accent on the second syllable of "upset" in the following contexts:
My current guess about what's going on is that the word is just not being assigned an accent to begin with. And without an accent on the second syllable, the stress on the first syllable no longer sounds less prominent than the stress on the second syllable.
Other words that I think show the same phenomenon for me:
- Japanese
- unknown
- thirteen and other number words, as Araucaria mentioned
Some words that are subject to this phenomenon seem to have alternative stress patterns in predicative position, depending on the speaker. For example, absolute can be accented on either the first or final syllable in a sentence like "A dictator's power was absolute". "Portuguese" as a noun or as a predicative adjective has final stress for some speakers, initial stress for others.
Another example that I find interesting is leftover/left over (which there was a previous question about). The final syllable is unstressed and so never accented; but I have stress on the first two syllables. The o of over is accented for me in a sentence like "There's only one left over!", but not in a phrase like "The leftover materials".