Probably accidental, I'd imagine? Like someone probably found some and didn't think about it before using it, only afterward realizing what they'd done?
Tbh, given how much Indonesian coffee cultivation is tied to Dutch colonialism, I was imagining a situation much more akin to how the Vietnamese came up with pho
The story I've always heard was that French colonial landowners were raising beef and the Vietnamese peasants could only get the less desirable cuts of the meat and so they came up with pho to make the best of it. No idea if this is historically attested!
A lot of sites reiterate that workers weren't allowed to pick beans for themselves and then discovered the civet droppings, which would suggest you're right.
But the source for all these things also seems to be "It is known.'