A.1 The lions reacted to my singing.
A.2 The lions reacted to me singing.
B.1 My singing alarmed the lions.
B.2 Me singing alarmed the lions.
As far as I know, both A.1 and A.2 are grammatical: "me" and "my" are interchangeable, although there is a little difference in meaning.
Can we say the same refering to B.1 and B.2? Why does B.2 seem ungrammatical? If it is, what grammatical rule, if any, impedes using "me" in B.2?