Closure content executed as transaction in Doctrine DBAL

Code
<?php

use Doctrine\DBAL\Connection;

/* @var $connection Doctrine\DBAL\Connection */

$function = function (Connection $conn) {
    
$conn->insert('test', [
        
'id' => '3',
        
'name' => 'bar',
        
'creation_date' => '2014-07-23 07:27:18',
    ]);
};

$connection->transactional($function);

$sql 'SELECT * FROM test WHERE id = ?';
$result $connection->executeQuery($sql, [3])
    ->
fetchAll();

dump($result);
Result
^ array:1 [
0 => array:3 [
"id" => 3
"name" => "bar"
"creation_date" => "2014-07-23 07:27:18"
]
]
Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8