Run RPC request against
I found the problem. Turns out the it was actually running as it should. The reason for the error message was that the program tried to decrypt the wallet, but I never encrypted it in the first place. After encrypting it, it works fine.