I can quickly think of 3 cases what could cause this:
1. The Build ability of the Drone has the Ignore Unit Cost flag set.
2. The Button has the Show Resource flag unset.
3. The Drone that is sacrificed may also have a cost, this cost is subtracted from the building cost, so it can be different from what is expected. If the Drone costs more than the building then there is no cost involved when building.
Perhaps 1 and 2 are not that likely, but they are settings that affect this.