Problem with bpy.context.selected_objects
So the thing that is you should always use context that passed by the operator instead of bpy.context. Unless you want to override context with the one you need in rare case.

And Blender 2.80 does change the object.select to its private(?) value, one should consider use object.select_set(bool) and object.select_get() for select value manipulation.

So assume that your function got a context passed in:
ListObjects = [ o for o in context.scene.objects if o.select_get()]
will give you a more reliable context.