That was a bug and has been fixed in the GoG version. I don't know if it is possible to change it to an older version, but if you want to be cheesy you can get infinite amounts of gold from the NWC dungeon chest. You can only get 10k at a time though, so you'll need teleport to a bank and it'll take a lot of time.
​
This is borderline cheating though, same as the bug that you are describing. If you don't mind cheating then it's easier to just download a save editor and give yourself all the gold/exp you want:
https://www.moddb.com/mods/might-and-magic-vi-save-edit-tool