You not loving me is my nightmare.
Is this sentence correct? If not, would you please tell me the correct form?
[You / your not loving me] is my nightmare.
Both forms of the personal pronoun are perfectly acceptable, though the genitive (possessive) form "your" is considered slightly more formal by some speakers.
Other than that, there is no semantic difference.
Note that "not loving me" is a verb phrase serving as predicate of the bracketed subject clause.
Learners in countries where English is 2nd language, use gerunds when they often don't get the proper noun form of a verb. They use running in place of race; loving instead of love (where 'love' functions as a noun); laughing in lieu of laughter. Sometimes it ends up being awkward when the noun form of 'give'becomes giving or gift, because both are different when used. Gradually these learners get used to the proper noun form; I also used to do it in the beginning.
Now, coming to the use of 'ing' form in such examples as:
You raising a question makes no difference, or Your raising a question makes no difference, the difficulty is defining the function of 'you' in the first sentence. In the second sentence 'your' functions as possessive adjective.
Strictly, since a gerund functions as a noun, the noun or pronoun should be in the possessive case giving "Your not loving me is my nightmare." but "You not loving me" is what you are most likely to hear in ideomatic speech.
The reason for using the possessive is that we don't use the nominative case with true nouns which would give sentences like "You coat is red", "John house is small", "Me car is a Volvo".
Actually there are non-standard English dialects where the posessive form of the first person singular is 'me' instead of 'my' but when users of those dialects say "me car" or "me 'ouse" (the possessive 'me' is usually accompanied by dropped 'h's) they are using 'me' as a possessive.