Basically, while "workbench.action.focusActiveEditorGroup" can be issued in a key binding, it seems to have no effect when used in a macro immediately after "editor.debug.action.selectionToRepl". What does work is to use the same key binding twice: in the second run, "editor.debug.action.selectionToRepl" does not do anything (there is no active editor and thus no selection) and the second command just works. However, this is only possible for key bindings which are not captured by the debug console itself, so not really a good workaround.
This issue is also described in https://stackoverflow.com/questions/49457051
Basically, while "workbench.action.focusActiveEditorGroup" can be issued in a key binding, it seems to have no effect when used in a macro immediately after "editor.debug.action.selectionToRepl". What does work is to use the same key binding twice: in the second run, "editor.debug.action.selectionToRepl" does not do anything (there is no active editor and thus no selection) and the second command just works. However, this is only possible for key bindings which are not captured by the debug console itself, so not really a good workaround.