Display subscribe to group on access denied page
You have a couple of options.

Not sure how you have your group node page setup but what I have done is use a node view panel.  In that panel I added the Field: Group (group_group) in a region then set the formatter to "OG subscribe link".  That will display the "Subscribe to group" link when a user clicks on the group they are not a member of.  Since you are getting access denied I'm guessing your group node page is not setup that way.

Another option is to modify the og-list view and add the field "Content: Group".  Then change its Formatter to "OG subscribe link".  That will create a new column in the view that will display a link called "Subscribe to group" for groups you are not a member of and "Unsubscribe to group" for groups you are a member of.