The Infinite Health cheat dumps you to the main menu almost immediately with an error message that is shown on page 1 of the thread.
As for the Infinite Encumbrance cheat, when you load a save you used it on I have no inventory whatsoever, like it's just missing.
When I mentioned it on the Pathfinder: Kingmaker discord someone remarked it might be because there is a finite limit on certain mechanics, and setting it to infinite or 9999999 or whatever breaks the game. I don't profess to know how it works, as I have the technical expertise of a mildly knowledgeable baboon, but that's what they said.