Issue title: QGIS3 ZoomToSelected() not working in Editor Script - works in Python Console but not the Python Editor
 Issue body: Using 3.10.1-A Coruña on Windows 10

I am writing a Python Script in the Editor but iface.mapCanvas().zoomToSelected() does not appear to be working at all in the Editor.

iface.mapCanvas().zoomToSelected() - works fine in the Python Console

**Editor code - apparently does nothing**
```
selectid = [2]
poalayer.select(selectid)
iface.mapCanvas().zoomToSelected() # does nothing
iface.mapCanvas().refresh();
```
**Console - works as expected**
`iface.mapCanvas().zoomToSelected()`

Let me know if I can provide any further info or do a test.
 Comments: 
 Comment 0: Not reproducible both Windows and Linux.
 Comment 1: Looks like local issue, probably data-related.
{'source': 'GithubIssues', 'repo_name_with_owner': 'qgis/QGIS', 'issue_id': 542724144, 'repo_stars': 6339.0}