Yeah, the buttons themselves just have conflicting IDs, and can be solved by creating the button with a suffix as suggested by the ImGui library.
Like this imgui.button("Escape##cancel_btn"), and only the "Cancel" text of the button will actually be visible.