Which method:
- selected_objects
- selected_bones
- selected_editable_bones
Are you sure that absolutely nothing is selected. If you’re unsure, do ALT+A to deselect everything. What could also be happening is that you’ve selected some other object as well as the active object in Object mode before switching to either Edit or Pose mode.