My answer is shown by example and may not represent Buddha’s teaching, but I think it’s worth considering. My goal is to show that intentional karma (karmic formation) can bear strange fruit (vipaka).
Let’s say I draw a tiger with blood all over it’s mouth for the reason of gaining some fame. Soon after publishing my drawing, I gain fame, but many tigers are slaughtered being considered over-populated predators, etc. Although it was not my intention to have tigers killed, I feel guilty nonetheless.
If I drew a tiger with blood and without the intention of gaining reputation, having it published, noticing tigers being culled for the same reason, I would likely feel guilty.
If I drew a tiger with blood and then erased the blood to an extent of invisibility having understood the inappropriateness of this gesture, and tigers were massacred for the same reason, guilt most likely won’t arise
If I drew the tiger without blood, without any thought of the aforementioned, and tigers lost their lives for the same reason, I would not feel guilty.
My point is karmic effects can occur in strange ways - by association in this case. A good association gives good results, and bad association give bad results. Why does the association occur at all? It seems like a lesson to be learned about developing unwholesome mental factors(cetasika). Mental factors (karmic formation) play an indirect role in all our experiences and activity. In my scenario, fame can be thought of as delusion or greed - an unwholesome mental factor. The result was bad intention, a bad karmic formation.