I think that your code whould work but doesn't because string ports
are not file ports and system commands pipes out to file ports.
'open-input-pipe' uses 'scm_open_process' that returns only a
read-port and a write-port, the write port is then taped the output
string in your run-command.
and it works.
ALso when you create a err-port with pipe, you create a file port
nad this will be used translated as an error port for the system
comand and it all works.
However the failing program uses a string port which is not a file
port and it does not end up capturing the error output in the
system command.
One would wish that guile if the error port is not a file port make
a file port, as done with 'pipe' and create a thread that pipes the
data from the file port to the non file port and your code
would work. Also similarly behavior for read and write ports
towards the shell.
the relevant code is in posix.c, scm_open_process