Erratic behaviour after rotation - what's going on?

I have an object (a cuboid) that floats upwards vertically until it hits a platform above it. It then rotates on one of its corners until it’s rotated by 90 degrees. That’s fine but after it does that it then decides to float downwards.

It’s a rigidbody but isn’t affected by gravity. There are currently no physics materials used in the scene.

This is what I currently have:

void Update () {
	if (isCollided && !isStopped)
	{
		// Move the object up
		transform.Translate(Vector3.up * Time.deltaTime);
	}
	if (isStopped)
	{
		// Object has hit the bottom of the top platform. From what direction did the original
		// collision come from?
		if (collisionDirection == CollisionDirection.Left)
		{
			if (transform.eulerAngles.z < 90)
				transform.RotateAround(pivotPoint, transform.forward  , 50 * Time.deltaTime);
			else
				ClearFlags();
		}
	}
}

void ClearFlags()
{
	// Clear the flags
	isStopped = false;
	isCollided = false;
	collisionDirection = CollisionDirection.None;
}

I have no idea why it’s floating down.

The most probable explanation is like this: it floats downwards because of the penalty force.

When you call transform.RotateAround, you move the rigidbody forcefully, not using the physics engine. It is possible that this movement causes your cuboid to slightly penetrate the surface that it hit. After your last call to RotateAround, the physics engine sees that there’s been a penetration, and applies a penalty force to your rigidbody. The rigidbody starts floating down, and when there’s no penetration any more the rigidbody keeps floating down due to inertia.

I would suggest to try and increase the value of minimal penetration for penalty. Does the problem go away?

I’m pretty sure it moves downwards because you move your object in local space. Take a look at transform.Translate() and the second implicit parameter. Probably your object is looking downwards, so moving it along it’s local up axis will move it down.