Red Box when clicking X to close form with embedded views

Hi there

I have a form that has several embedded views in a tabbed table.

Whenever a user is has selected a document in the embedded view and clicks the X to close the window the red box of death appears.

Funny thing is that if they use the close button in the action menu i created it closes fine. It is a simple @command([fileclosewindow]) action. WEIRD

I can duplicate this but have no idea what would cause it.

Any ideas?