Encountered same issue. I think the file is empty because openssl gets stuck before requesting passphrase. I was able to workaround this by providing passphrase inline (e.g. 'abc' below):
openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 des3 -inform PEM -passout pass\:abc -out rsa_key_enc.p8