Deleting All Bookmarks in Folder (weird Fx bug?)

I’m trying to delete all bookmarks in a particular folder (used as a temporary storage area). Code appears to work fine but a weird bug occurs in certain situations. If the folder has been opened prior to the deletion and there was more than one bookmark in the folder, deleting the bookmarks via the add-on code results in the folder refusing to open and display the expected ‘Empty’ popup. A tiny line appears and it won’t open at all. (Hiding/re-displaying the Bookmarks Toolbar it’s on, or restarting Fx fixes the display issue.) I seem to remember encountering this same issue previously on some other add-on I had installed, and suspected this might be a Fx bug, but could not locate it in Bugzilla. Can someone confirm or know the Bug # or better yet know a workaround? Below is the code I am using; I’ve tried various methods including deleting, then creating a dummy one via code before removing it but so far no luck. Code is triggered via browser action toolbar button. (Removing the dummy works if done via 2nd browser action button click; obviously not ideal.) Thanks.

let itemsInFolder = await browser.bookmarks.getChildren(folder.id);
for (let item of itemsInFolder) {
  await browser.bookmarks.remove(item.id); 
}