The name of the second node is probably exactly the same as the first node but with a “2” added to the end. Sibling nodes can not have the same name in the same scene.
I would avoid using names for things like these. Instead add a function like pickup() in the coin, and then call it.
func _on_body_entered(body)
if body.has_method("pickup):
body.pickup()
The pickup function in the coin script could look however you want. The example below would make what happens identical to what you want with your current solution.
Did you connect the area’s signal? Maybe showing your scene tree would help.
I assume the “CharacterBody2D” name is supposed to be your player? That should work for all coins, but it still may be better to use Groups with .is_in_group("player") in case your player node name changes or you add another player.
Have you forgotten to change collisions for one of them?
You do that by opening the scene, selecting the area node and going to “Collision”. Compare what you see for the normal coin and the mega coin. If anything you see is different, change it so that the not working scene gets the same as the working scene.