In BrE I would say you only do it to yourself when you are very frustrated with yourself. It is used when the bad outcome of doing something is your own, or partially your own, fault.
Matthew, I can't really think of an example in that context. It may be possible. I am trying to think of an example where you might use it. I would say it would probably be more unusual.
However, it could work like that, in this sort of sentence: "When the bus didn't turn up, I lost patience with myself over the fact that I kept going to the wrong bus stop!". :up:
But, even there, you are blaming yourself [and getting frustrated], because despite getting it wrong previously, you keep making the same mistake by going to the wrong bus stop.
So, thinking about it, to me, it is used when you blame yourself for things that go wrong which are your own fault. Usually, it is something that you are doing wrongly which you think you should be able to do.
In, "I lost patience with myself because I couldn't program the computer.", the "I lost patience with myself" element is almost idiomatic. It is because you "lost" your patience, which in this context, implies that it has happend at least once before, despite your attempts to get the task right.
e.g.:
"I lost patience with myself because I read the paragraph several times, but still couldn't understand it." (You blame yourself for not concentrating).
"I lost patience with myself over the fact that, during the fire drill I ran into the wall again rather than going out of the door, for the third time this week!" (You blame yourself, because using a door should be easy).
Is that any help?