If you train to maximize performance in one style, then you should stick to it. Especially if the style you want to focus on has a fairly high skill component (olympic lifting or gymnastic work for example) since you need to keep practicing those skills to stay good at them.
But if you are more into a low-skill thing like powerlifting (low skill in the way that the movements used are not super technical like olympic lifts and gymnastic work) you can likely go back and forth between powerlifting and bodybuilding training. Heck, a lot of powerlifter train like bodybuilders for pretty much everything except their bench, squat and deadlift. Hey, even Eddie Hall (who deadlifted 500kg and is a top 5 strongman competitor) does a lot of his training bodybuilding style.
Heck even olympic lifters from the 50s trained for olympic lifting most of the year, then did bodybuilding work for 2-3 months.
If you plan to excel today though, you likely need to focus on one style. But if you have no plan on being world class or national level in a sport, you can simply train hard and change your style once in a while. Especially if you use the change of pace to correct weaknesses.
Just because something gives you lesser improvements in the short/medium term in something doesnt mean that its not good. Some of us simply want to look better, be leaner and perform better.
BTW if you decide to stop focusing on heavy lifting and do more bodybuilding work you CAN lose your capacity to demonstrate strength. Displaying strength is a skill. And if you stop doing it, you become worst at it. But if you don't lose muscle (or even build muscle if you are bodybuilding) the strength will quickly come back one you start focusing on heavy lifting again.