This is really annoying, it happens very often in 100% races. Your race is practically over if you get lapped. And it creates dangerous situations on the restart where lapped cars get blue flagged and have to give up lots of positions while fighting other lapped cars for positions.
I have been thinking about how to fix this for a while. In Codemasters defense, there are many challenges to solve to get it working smoothly. IMO it couldn't work exactly like real F1.
Here are some of the challenges and my thoughts about how they could be solved:
How to unlap safely?