Yes you are misunderstanding the way the cap and bonuses work. Your player who counted as 16 million no matter what must have been one a one year contract.
The bonus counts against the cap but is amortized over the duration of the contract. So if you have a player on a 4 year deal making 1 million in base salary with a 16 million signing bonus, that player's cap number is 5 million per year (1 million in salary + 16 million/4 years).
Also, cap penalties are incurred when a player is cut or traded before his contract is up. The penalty is equal to the remaining portion of the bonus which has yet to be counted against the cap. So if you cut the player in the example from the previous paragraph after the second year of his four year contract, he will actually count for 8 million against your cap the following year even though you are no longer paying him.