welcome to the Ranch, almahoom!
Putting control characters into regexes on Linux/Unix command lines can be maddening. More so since the rules change between raw command-line input and scripts, much less between different unix-like systems and shells.
But I found this discussion helpful:
https://stackoverflow.com/questions/45620124/insert-blank-line-before-line-matching-pattern-in-sed
On my Linux system, this particular expression worked like a charm:
where the a blank line gets inserted before the line that contains "happy" in the file named
test.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.