If you think you understand something, write a simulation which you expect to work based on that understanding, and it doesn't work - did you really understand it?
Maybe, maybe your simulation is just buggy. I can write a simulator of how my wife would react to the news I'm cheating on her, and fail miserably, but I'm quite positive I understand how she would actually react.
Not necessarily. A working simulation (for some testable subset of states) doesn't carry any hard and fast logical implications about your understanding.
On the other hand, assuming no errors in implementation then a broken simulation which you had expected to work directly implies that your understanding is flawed.