If it is an action buttun did you try to set disable during action to yes? Because to me it looks like sometimes double clicks are registred. By setting it to yes an user can only click once on the button.
Regards,
Ronald
For anyone else experiencing this issue, Mendix has confirmed that it is a bug and they are currently working on the issue.
For those that haven't yet encountered this problem, it will occur when you have 2 or more TemplateGrids on different tabs of a Tab Container. (In my scenario, I have a Tab Container with 3 tabs and each tab has 1 templategrid.)
My testing suggests that 3 calls occur when closing a page that attempts to return to Tab 2 or 3:
Call #1 or #3 will contain a Null value for the Context variable. If call #3, contains the Null, then an error will occur within your app.
Hope this helps someone out there.
Form your description this looks like it is simply a Mendix bug. If you feel like it you could submit a ticket for it in the support portal.