There are three different verbs to think of here:
mit jemandem kommen=
come with somebody The
mit jemandem is an obligatory object here.
come, arrive, … Has no obligatory objects.
cum, get to orgasm Has no obligatory objects.
Negation usually encompasses a verb with all its obligatory objects. So for the first verb the usually negated sentence is your second proposal:
Es tut mir Leid, dass Du nicht mit mir kommen kannst.
Observe, that verb and obligatory object stay together and are not separated by
On the other hand, if
nicht separates the
mit mir as in your second proposal
Es tut mir Leid, dass Du mit mir nicht kommen kannst.
then there are several possible meanings associated with that:
- It's still the first verb, but there is heavy emphasis on the object
mit mir. With somebody else the addressee might come.
- It's the second verb and
mit mir is a modal adverbial. This is rather strange because there is only minimal difference to the first verb.
- It's the third verb and
mit mir is a modal adverbial. This is perfectly fine considering the grammar.
As the first verb is rather uncommon in spoken language (except maybe for high registers) and the second sound strange here, most people will guess the third meaning (at least if they know that meaning of
Beware: For all possible verbs, the position of
nicht sets an emphasis that may alternatively be conveyed by stressing the respective words.