Cannot sudo anymore - macOS Catalina
It seems the solution was after running 1st command to run:

sudo -s


Somehow it fixed situation and now again both commands are working without any problem as they did before. Hard to say what was the reason for this (maybe introducting zsh) but now I can again edit files I need