Now i get the error
ERROR parsing wallet.dat, type b'mkey'
You mean this specific comment:
link?
If so, the OP's issue about
type setting error isn't related to the
type b'mkey' error that you're getting.
AFAIK, you'll get that if the wallet.dat is corrupted or if it's in a similar state.
You can try to open a new issue in that repository since I haven't found any duplicate.