When addressing someone with a term of endearment, should the gender of "my" match the word or the person? For example, when addressing a male as "my star", would you say Звездочка моя or Звездочка мой?
The gender of pronoun should match the gender of the endearment word.
Another example, there's a word of endearment зайчонок (bunny). When applied to a woman, as it often is, the combination looks like мой зайчонок where мой is a masculine form agreeing with masculine зайчонок.
However there're cases where а pronoun can also provisionally match the person's sex, that is when nouns have a feminine ending but are essentially gender-neutral, e.g. умница/чка, лапочка/лапуля, молодчина/нка and again зайка.