cost (someone) dearly
To cause dire, harmful, or problematic consequences for someone, especially regarding a foolish action or a mistake. Drinking all night before his final exams is going to cost him dearly. That late penalty could cost them dearly, as it now puts their opponents within range to tie the game.
pay too dearly for (one's) whistle
To spend a lot of money or effort on something that is ultimately disappointing or unfulfilling. The phrase refers to a story by Benjamin Franklin about a boy who wanted a whistle so much that he overpaid for it and soon lost interest in it. I worked night and day to get this position, but now I have very few friends—I guess I paid too dearly for my whistle.