How to butter-roast coffee in frying pan?
Just frying them in butter won't work. The temperature needed to roast the bean is much higher than the milk solids can handle. If I were you, I'd begin by clarifying the butter to get rid of the milk solids, then use the clarified butter with the same method you are using now.

References:


Temperature scales for various roasts at the bottom
One way to make clarified butter