I got the same error while doing repair on MongoDB 4.0.5. The problem was fixed when I removed the --config option from the startup arguments.