Note that a command with an event designator is not inserted into history as is. It gets expanded and then entered to the history. That is why in the third command (echo !!!), the event designator is not replaced by echo !!, but by echo echo !.