In fact there is a better way to signal collision detection of exiting Polygon2D.
- On CollisionPolygon2D set BuildMode to Segments
- Use signal body_entered on Area2D (instead of body exit).
The trick (hack) is in the way how polygon is built. In “Segments” mode is a polygon constructed as Concave - reacts only to polygon edges!