Hello, I have fixed the bug reported in https://lists.gnu.org/archive/html/emacs-orgmode/2010-08/msg00188.html, https://lists.gnu.org/archive/html/emacs-orgmode/2019-02/msg00333.html, and https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00127.html. In the last of those threads (two emails) I explained in detail the bug and the reason it happens. Here is the patch: