I used some similar code in my platform game to remove coins after the player collected them. I was originally using queue_free() but that was causing trouble with associated code.
The more complicated option:
$AnimatedSprite2D.visible = false
$CollisionShape2D.set_deferred("disabled",true)