The angle function doesn't consider the scaling of the local coordinates, so it needs to be removed first. Fixes #23247