It's saying retrieveExternalAccount is returning empty. I just tried passing the ID as in API examples they're passing account id and card or bank id.
$linkaccount = $stripe->accounts->retrieveExternalAccount(
$STRIPE_DEST,
$linkaccount->id,
[]
);
Does this line have the correct syntax?
if ($linkaccount->object == "bank_account"){