In practice, this equation won't even hold for the vast majority of bonds in the US Treasury market, which is the most liquid government bond market.
The chart below shows the spreads of US Treasuries relative to a fitted curve (more specifically, a model price is calculated for each bond by discounting its cash flows using a theoretical zero coupon curve. The difference between the model yield and the market quoted yield is shown in the chart):
As you can see, nearly all Treasuries trade at a small spread to the theoretical yield curve. These spreads change over time, providing a lot of relative value trading opportunities. Relevant to your question, these spreads don't always exist because of liquidity reasons. For example, some bonds might trade rich relative to their theoretical values, because they're trading special in the repo market ("financing advantage"). In fact, a bond might be expensive relative to the theoretical curve precisely because it's too liquid and everyone's buying it ("liquidity advantage").
During times of stress, these spreads can become much larger. A similar chart for December 15, 2008 is shown below. Note the range on the y-axis:
Some bonds, such as 10-year on-the-runs and the 15-year sector, traded very rich (at extremely negative spread), because of high demand from investors looking for safe and liquid instruments. By contrast, old 30-year that have rolled into the <10-year sector traded at very cheap levels (very positive spread), because people were dumping these papers and moving into more liquid instruments or cash.