It depends. I did not end up using a letter from one of my PI's because I had done research with someone else who I already had a letter from. I also had two additional letters in my committee packet so there wasn't really a need at that point.
If you don't already have a lot of LOR's to choose from, then I would get an LOR from your PI as someone who you worked with for two years should know you well and can write a stronger letter. Other's can chime in if they don't think its a good idea, but I would ask your PI if they would feel comfortable writing you a strong letter to medical school. I think you may be overanalyzing the situation, however. There were plenty of times in undergrad when my PI yelled at me for messing up an experiment or doing this or that. If you were consistently being lazy that's a different issue, however. Do you feel that you were?