I think it is a commonly held view that HC Andersen conceived of TLM after his unreciprocated love interest in his (male) friend. https://www.huffpost.com/entry/hans-christian-andersen_n_563...
LOL, brutal.
I don't know if this biographical reading is valid, but the interpretation predates the Disney version and have nothing to do with modern identity politics. If anything, the Disney version tones down this subtext.