MONTPELIER — A bill to allow doctors to prescribe lethal medication to terminally ill patients could be heading for trouble as the Vermont Senate prepares to debate it.

The Senate on Tuesday rejected a Judiciary Committee recommendation that the bill be defeated. But now as the bill comes up for preliminary passage Wednesday, there may be more efforts to introduce big changes or delay action.

Sens. Peter Galbraith and Robert Hartwell — two key votes who’ve been undecided on the measure — have introduced an amendment that would replace the entire “end-of-life” choices bill with a measure granting immunity to physicians and caregivers when a terminally ill patient uses prescribed medication to end her or his life.