If you have BIAB 2020 or later, BIAB now has multi riff just like RealBand and using the multi riff feature you can now generate and replace selected bars or the whole track.
Here's a link to a PG Music tutorial -
Multi Riffs Feature Explored If you don't have BIAB 2020 or later, you can use the Audio Channel and the Audio Editor to highlight a replacement phrase from another bar in the track and overwrite the offending bar and accomplish the same thing. Using the Multi Riff feature will give you 7 new options to choose from but the copy/paste is quick.