To me, both 1. and 2. admit the same unmarked meaning.
1. I miss this: being with my friends.That is, miss not being and miss being can and, indeed, do express the same meaning.
2. I miss this: not being with my friends.
Sentence 2., however, can carry an additional meaning (as David points out): the opposite of its literal meaning, and the opposite of what the person intended:
2. I miss not being with my friends.In this case, sentence 2. would be deemed ungrammatical on the basis that it expresses the opposite (meaning) of what the person intended. However, if the person's intention is to express irony or sarcasm, then both a. and b. would be deemed acceptable marked/forced readings, and, moreover, to add to the semantic tangle, b. could be
a. I don't miss being with my friends.
b. I don't miss not being with my friends.
deemed unacceptable given its (apparent) double negative: sentence 2b. could be argued to have an additional meaning, sentence 1.
The problem, or rather the psycholinguistic puzzle we are dealing with, which is related to less in could care less vs couldn't care less, both of which mean don't care, is that the implicit negation in some words, like less and miss make their semantics difficult to untangle.
This explains why the errors [i.e., saying the opposite of what one means; e.g., sentence 2] are not detected and corrected: we accept an interpretation that is a priori
the plausible one, even though it's incompatible with the sentence as written or spoken, because it's too hard to work out the semantic details. Examples
"That'll teach you (not) to tease the alligators."
"No head injury is too trivial to ignore."
"Do not fail to avoid neglecting this post."
Read more here Language Log: Why are negations so easy to fail to miss?