Your error says that the "_on_area_entered" function cannot be found, so focus your attention on that it.
I tried to copy your code (in a simpler version), but I got no error for it.
Maybe your "_on_area_entered" function is not properly connected to the "area_entered" signal. To make sure, you could reconnect the signal again.
Maybe connecting the signal directly in code will fix it. In the _ready function, you would need to write:
For better understanding of my statement above, watch this video https://youtu.be/qkLBzm5D3Rs
Overall, I am very unsure why your error happens. It is strange that it suddenly starts working after a few seconds.
@lemu_kymoh thanks for your help. I have a mistake when I fogot to turn off the comment in another script. I have changed the connect method too and it's work. Actually, it's still delay a bit but I don't think it will become a big problem.