The bold+italic text quoted below doesn't explicitly validate your question:
"Can you truly sign in to a device for the first time in settings and make it a trusted device in order to receive verification codes simply by knowing the Apple ID, password and passcode of the trusted device of the trusted phone number"
However! The second quote does actually validate what you described as a method of making a Mac a "Trusted Device" by signing into iCloud. Given that, I'd guess that what you observed is probably expected behavior.
I haven't found any articles/documentation suggesting this, but I feel like there might be other variables which affect Two-Factor Authentication log-in behavior that aren't made available to the public.
Either way, after I came across your post and found this answer, I changed my iPhone passcode from 4-digits to 6-digits ⚠
Source: Two-factor authentication for Apple ID
Trusted devices
A trusted device is an iPhone, iPad, iPod touch with iOS 9 and later, or Mac with OS X El Capitan and later that you've already signed in to using two-factor authentication. It’s a device we know is yours and that can be used to verify your identity by displaying a verification code from Apple when you sign in on a different device or browser.
Trusted phone numbers
A trusted phone number is a number that can be used to receive verification codes by text or phone call. You must verify at least one trusted phone number to enroll in two-factor authentication.
You should also consider verifying other phone numbers you can access, such as a home phone, or a number used by a family member or close friend. You can use these numbers if you temporarily can't access your own devices.
Source: macOS Sierra: Use two-factor authentication for security
Add a trusted device
To make a Mac (OS X El Capitan or later) or an iOS device (iOS 9 or later) a trusted device, you must sign in to iCloud using your Apple ID account on the Mac or device.
On a Mac:
Choose Apple menu > System Preferences, click iCloud, enter your Apple ID and password, then click Sign In.
Enter the passcode you use to unlock your other trusted Mac or device, then click Continue.
Select the iCloud app options you want, then click Next.
On an iOS device:
Go to Settings > [your name] (at the top of the screen).
Verify your identity with a six-digit verification code.
If you previously signed in, sign in again. You won’t be asked for a verification code again on that device unless you sign out of iCloud completely, erase your device, or need to change your password for security reasons.