I don't know if it is a bug or not but it has been that way until Photoshop CC. Really it still is that way, CC added a new property to artLayer that will let you get the bounds without effects.
If you don't have CC you need to turn off the layer effects before getting the bounds. Note not all layer effects change the bounds but it is easier just to turn the effects off as a group.
Thanks for the reply Michael,
But I need to get the bounds with effects on it.
Let's say we apply stroke to an object. Now the height and width of that layer changed.
I need to get the correct bounds of that layer with stroke applied on it..
Is there any solution for this?
What version of Photoshop are you using? In every version I remember the bounds included layer effects if the effect changes bounds. For example a 3px inter stroke effect would not change the bounds but that same size storke set to center or outer would change the bounds.
So you should not need to do any extra steps to get the bounds that include the effects. app.activeDocument.activeLayer.bounds will give you the bounds with the effects applied.