Hi, I am using 2.22.2, \after 4 \sustainOff b2 r is useless, because of *unknown escaped string*
"Useless" sounds a bit harsh.Could you consider upgrading to LilyPond 2.24? That's the current stable version (and my code was written for it). If that's impossible, I can sidestep the use of \after, but frankly, it's easier to help you if you provide a working example yourself.
Lukas