Think of coffee grounds like it's crushed malt - if it's held at too high a temperature, or sits in water too long, or is brewed with too much water, you will get bitterness and astringency. That might actually help you to match what your end-goal beer is; it will also help lower the mash pH. Keep in mind though that if you are brewing a darker beer, the roasted malts will already be providing all the astringency, bitterness, and acidity you need.
I'd personally prefer brewing it separately and then adding it to your chilled wort, but that's just me.