That's just going to happen from time to time. However, it can happen after you click on any button on the forum - not only the Post button - and your post may not have actually gone through when you check afterward.
You were smart to go back to your post with your browser's back button because that way, if the post hadn't gone through, you wouldn't have had to write it over again. Another smart thing to do is to bring up a second instance of your browser to check if your post went through rather than use the current instance. Normally, you'd still be able to navigate back to the posting page, but not always...