Note that man bash strictly speaks about "vi-mode", not "Vim-mode".
You can't expect Vim features.
A convenient workaround is to use Vim to edit your command line which works naturally when set -o vi is set.
Go to Normal mode with Esc and press v to edit your command line in vi (which will be an alias to Vim in any reasonably modern system).
This starts your regular Vim and will source your vimrc with whatever commands you put in there.
After you're done editing your command, use :wq to run it or :q! to abort.
As to your macro, you could probably just use dd which will delete the entire line and put the deleted text in the unnamed register.
The macro in your question differs from dd only in that register 0 will contain the yanked text (the deleted line without a linebreak).
escapekey and then the lettervwhile in command line.