The '$' character should be escaped when it is not used in a spot that makes it act as a special character.
It is the same as ^, but refers to end of pattern space. $ also acts as a special character only at the end of the regular expression or subexpression (that is, before \) or \|), and its use at the end of a subexpression is not portable.
Reference: https://www.gnu.org/software/sed/manual/html_node/BRE-syntax.html
The test test_bre11 is failing because the '$' is not escaped. On the other hand, test_bre13 works almost by accident, because the '$' character is never escaped in the first place. Both of these tests should pass after fixing the interpretation of the '$' character.