Add Post Tags to Body Class

That is because the get_the_tags() function returns an array with the tag id as the key value. You could use array_values( get_the_tags( $post->ID ) ). That should do the trick.

error code: 523