Script to remove faces with significantly different normals
A script to select verts based on the angle between normal and radial vector.



An alternative script than the one shown in question link.

In the case where the object is spherical, , after changing the object origin to the centre of the base ring if hemisphere (or where sphere centre would be), can then check the angle between vert  normal and vert coordinate (since vert.co is  also the vector from (0, 0, 0) origin). If it was a perfect sphere, all these angles would be zero.

Test script to run in edit mode. (In vertex selection mode) Change the 90 degree value of angle_check = radians(90) to suit.  The script only selects verts with an angle of norm to radial outside angle_check.

import bpy
import bmesh
from math import radians
context = bpy.context
obj = context.edit_object
me = obj.data
bm = bmesh.from_edit_mesh(me)
angle_check = radians(90)
for v in bm.verts:
    v.select = v.normal.angle(v.co) &gt; angle_check

'''
# or by faces
for f in bm.faces:
    f.select = f.normal.angle(f.calc_center_median()) &gt; angle_check

'''
bm.select_flush(False)
me.update()