[Tex/LaTex] LyX: why does figure-wrap-float overrun the page

floatslyxpositioningwrapfigure

I find that when I add figure wrap floats to LyX documents, often they will be placed poorly such that they overrun the bottom of the page. This is always accompanied by some of the text on the next page wrapping around nothing, as if the float had continued on that page. Example:

Can anyone tell me why this happens and how to avoid it? In the settings for the wrap float, I see 'Allow floating', so I presume the typesetting engine should be free to find a more suitable location. Note that this does not always happen, but in a document with several figures densely placed in the text, it is very likely to occur.

The floating capabilities of wrapfig and relatives are restricted; in particular, placement near a page break is problematic. The wrapfig documentation mentions these facts: