You have two main problems which we can only deduce by the bits of extra information that you’ve given throughout your comments here.
First of all your calculation of your “newPosition” makes no sense. transform.position is already the position of the object in world space. TransformPoint transforms a local space position into worldspace. Since you pass in a worldspace position the outcoming position is nonsense. So like @JVLVince said in the comment below his answer you just use the object’s position.
Next thing is the Bounds struct is a 3d construct. So Contains always works with 3d coordinates. As we can see in your screen shot in one of your comments your Bounds center is at (8.0, -21.2, -0.7). Since the extents is (17.2, 6.3, 0) it will represent a “thin” box with 0 thinkness which is located at z “-0.7”. Of course when you pass in a position (x, y, 0) it will never be inside the bounds.
You could tranform the 3d bounds into a “2d bounds” which simply ignores the z value.
public static class Bounds2DExt
{
public static Bounds Get2DBounds(this Bounds aBounds)
{
var ext = aBounds.extents;
ext.z = float.PositiveInfinity;
aBounds.extents = ext;
return aBounds;
}
}
This will simply set the z value of the extents to infinity so the 3d box goes from negative infinity up to positive infinity so the z value doesn’t matter. With this extension class somewhere in your project you can simply do:
if (area.bounds.Get2DBounds().Contains(transform.position))
This should work with any 2d value regardless of what z value it has.