Your problem is happening because you didn't respect what it says in the
template language manual, "Do not use subtemplates (`{ ... }`) as function arguments." In addition, in single-function-mode spaces are significant. You should include them only where you want them in the output.
The most general way to fix this is to use general program mode. Something like
Code:
program:
contains(
field('#genre'),
'Sachbuch',
field('title'),
strcat(field('authors'), '_', field('title'))
)