loop inside a loop : search for posts in the same category

the_ID() prints the current post’s ID. You need to use get_the_ID() to return it.

Also, get_the_category returns an array of category objects – one foreach category term the post belongs to.

The ‘category’ attribute expects a category term ID. So you need to pick a category object, then obtain its ID:

  $cats = get_the_category();
  $cat_obj = array_shift($cats);
  $cat_id = (int) $cat_obj->cat_ID;

Then:

$args = array( 'numberposts' => 5, 'offset'=> 1, 'category' => $cat_id );