I cannot reproduce this issue using the provided code snippet and a source build.
Unfortunately, I also cannot find a lot of references for the mentioned RuntimeError. Could you post the complete stack trace, please?