Is there something about black pepper that changes while frying?
@Megha's suspicion of too-high heat is spot on.
The primary flavor oil in black pepper is piperine and its melting point of 130°C is below that of the Maillard reaction of 140°C to 165°C. You were likely frying the vegetables until they were nicely golden on the outside, which happens via the Maillard reaction. By adding ground pepper during that frying phase, the piperine is breaking down and adding a bitter flavor to your dish.
Potential solutions are:

Grind the pepper more coarsely. With less surface area, the pepper will break down more slowly and you'll get more pepper flavor remaining and less bitter.
Learn to enjoy the bitter.
Wait until your veggies are all nicely browned and turn down the heat. Then add your pepper (and turmeric). You want some heat to melt the oils in the pepper so they migrate into your food but not enough to break them down. The piperine will start decomposing at boiling point. To retain the pepper flavor, don't boil your dish very long.
Add pepper at the very end, after your water has been absorbed and the heat is reduced.

A fun and satisfying way to experience this is with a potato. Dice up the potato and divide into 3 parts. Add the pepper at the beginning of frying with the first portion of the potato. Add the pepper during the final minute of frying with the second portion. Finally, cook the last portion of potato to completion and then add pepper while the potato is in the warm pan. To compare, warm all three portions of the potato and compare the flavor. I don't mind bitter so I add pepper willy nilly for myself. My kids feel differently.