Maybe the floor_registeted is really null? I observed you had set it only if any CollisionPolygon2d should enter, but the area only detects any static or rigid body not a single collision shape.
Using the name “CollisionPolygon2D” to check if it was a floor you touched is not the most reliable. First of all, I think it’s not the collision polygon that gets passed to _on_body_entered, but its parent (probably a staticbody). Second, what if at some point you make one with a different name?
A better solution would be to use either collision layers or groups, since that should at least prevent spelling-related problems. It’s still possible to forget to set the layers/groups on a part of the floor, but I don’t know of a way to completely prevent that…