The function blocks_have_content checks if blocks on the left or the right contains any content. It is supposed to return false if there are no blocks, or if the blocks won't output anything.
In fact it returns true if there is a block which would output something, but which is set to visible=false in the site level block settings.
Visible is checked at the block instance level (the eye icon on the course page) but not at the site level (the eye icon on the admin/modules/blocks/manage blocks page).
1. Use suitable course
2. Move all blocks from right-hand column to left-hand column, except one, e.g. Recent Activity
3. Go to the admin manage blocks pages and click the eye icon next to Recent Activity to hide it
4. Back on the course page, turn editing off. Observe that the block has disappeared, but there is still space reserved for the right column even though it is now empty
You can also note that if you instead use the eye icon on the individual block itself, the 'empty' column disappears correctly.