Heisenberg issue in Acceptance Testing

This test behaves correctly when Xdebug is ON, and incorrectly when its OFF.
However, the second problem with not seeing the record occurs regardless of Xdebug status.
Please read the comments in the code.
If I remove the attributes of ‘mobile_verification_status’ and ‘status’ from the problematic seeRecord, it works. The record is saved in the test database correctly with correct status and mobile_verification_status. I checked it a hundred times.

Any idea?

public function signupAndVerifyByMobileSuccessfully(AcceptanceTester $I)
    {
        $I->fillField("SignupForm[mobile]", '09122499514');
        $I->fillField("SignupForm[email]", 'nima.naraghi4@gmail.com');
        $I->fillField("SignupForm[password]", 'tester_password');
        $I->fillField("SignupForm[password_repeat]", 'tester_password');
        $I->click('Signup');

        $I->wait(3);

        $I->seeRecord('common\models\User', [
            'mobile' => '+98 912 249 9514',
            'email' => 'nima.naraghi4@gmail.com',
            'status' => \common\models\User::STATUS_INACTIVE,
            'email_verification_status' => false,
            'mobile_verification_status' => false,
        ]);
        
        $I->wait(3);

        $I->seeInCurrentUrl('verify-mobile');

        $I->wait(7);

        $I->amGoingTo('Get the generated mobile verification code');

        $user = $I->grabRecord('\common\models\User', [
            'mobile' => '+98 912 249 9514', 
            'status' => \common\models\User::STATUS_INACTIVE
        ]);


        $userVerificationCode = $user->mobile_verification_code;

        if(empty($userVerificationCode)){
            throw new \Exception('user verification code is empty'); // **It doesn't happen only when the Xdebug is ON very much like Double-slit experiment in the quantum mechanics.**
        }

        $I->fillField('MobileKavenegarVerificationForm[mobileVerificationCode]', $userVerificationCode);

        $I->wait(3);

        $I->click('Submit');

        $I->wait(5);
        
        $I->seeRecord('\common\models\User', [ // **This does not see the record whilst it exists.** 
            'id' => $user->id, 
            'mobile_verification_status' => \common\models\User::MOBILE_VERIFICATION_STATUS_VERIFIED, 
            'status' => User::STATUS_ACTIVE
        ]);

        $I->see("Your mobile was successfully verified.");
        $I->see("Congratulations! Your account is now active.");
    }

Ok. Another one:

It behaves like the first test I posted when depending on Xdebug status. Although, uncommenting/commenting the commented section has the same effect.
Spooky, right?

public function signupAndVerifyByMobileSuccessfully(AcceptanceTester $I)
    {
        $I->fillField("SignupForm[mobile]", '09122499514');
        $I->fillField("SignupForm[email]", 'nima.naraghi4@gmail.com');
        $I->fillField("SignupForm[password]", 'tester_password');
        $I->fillField("SignupForm[password_repeat]", 'tester_password');
        $I->click('Signup');

        $I->wait(3);

        $mobile = "+98 912 249 9514";

        // $I->seeRecord('common\models\User', [
        //     'mobile' => $mobile,
        //     'email' => 'nima.naraghi4@gmail.com',
        //     'status' => \common\models\User::STATUS_INACTIVE,
        //     'email_verification_status' => false,
        //     'mobile_verification_status' => false,
        // ]);
        
        $I->wait(3);

        $I->seeInCurrentUrl('verify-mobile');

        $I->wait(7);

        $I->amGoingTo('Get the generated mobile verification code');

        $user = $I->grabRecord('\common\models\User', [
            'mobile' => $mobile, 
            'status' => \common\models\User::STATUS_INACTIVE
        ]);

        $userVerificationCode = $user->mobile_verification_code;

        if(empty($userVerificationCode)){
            throw new \Exception('user verification code is empty'); // It doens't happen only when the Xdebug is ON due to Heisenberg problem.
        }

        $I->fillField('MobileKavenegarVerificationForm[mobileVerificationCode]', $userVerificationCode);

        $I->wait(3);

        $I->click('Submit');

        $I->wait(5);
        
        $I->seeRecord('\common\models\User', [ // this doesn't see the record whilst it exists. The reason is unknown
            'mobile' => '+98 912 249 9514', 
            'mobile_verification_status' => \common\models\User::MOBILE_VERIFICATION_STATUS_VERIFIED, 
            'status' => User::STATUS_ACTIVE
        ]);

        $I->see("Your mobile was successfully verified.");
        $I->see("Congratulations! Your account is now active.");
    }

My Acceptance suite if it helps:

suite_namespace: frontend\tests\acceptance
actor: AcceptanceTester
modules:
enabled:
- WebDriver:
url: http://front.xxx.home/index-test.php/
browser: firefox
- Yii2:
part: [orm, fixtures, init, email, Filesystem]
entryScript: index-test.php
cleanup: true
- Db:
dsn: ‘mysql:host=localhost;dbname=xxx_test’
user: ‘root’
password: ‘’

Update:

The solution proposed to the problem below might be relevant to this topic.
Having investigated it, I will post the result here.

What was the results?