Happens to me as well.
I suspect that the status indicator is take from your login for the account pages and not the community. When you first login and spent a bit of time on the community your session for the accounts pages will expire and you will be logged out (of the accounts pages) - which will cause the status indicator on your profile page to show you as offline.
Of course I may well be wrong and probably are wrong.
Perhaps @alex_w can shed some light on this?