With the wording of produce flame, it seems like you take the cast the spell action to make the flame appear. You can then attack with it later - it does use the wording "ranged spell attack." It never addresses what you can do with it otherwise, even though you are still holding a handful of flame.
What if a tavern brawler or a Monk punches with the hand holding the flame, or uses that hand to make a special melee attack (grapple or push?)
Would that be considered a spell attack, or an unarmed strike because the hand is passively holding the flame? Could you use the flame as an improvised weapon?
Or would it be something else?
Note:
I am making a character for a silly one shot. I am not planning on trying to pull this off for a serious campaign, but it is worth trying as a goofy concept. This side note probably won't affect any answers but I wanted to include it anyway.