You don't quite have it right.
The rifle fires.
Gas travels down the gas tube and enters the bolt carrier, blowing the carrier to the rear.
As the carrier starts to the rear, the cam surface forces the bolt to rotate and unlock.
The bolt and bolt carrier move to the rear, compressing the recoil spring.
The bolt carrier and bolt are forced forward by the recoil spring.
The bolt strips off and chambers a round.
The bolt STOPS against the barrel extension.
The bolt carrier CONTINUES moving forward, and the cam surface forces the bolt to rotate, locking it.
What's happening is, the bolt carrier when moving to the rear drags the bolt with it, forcing it to unlock.
On the forward cycle, the bolt carrier is PUSHING the bolt, and continues to move forward after the bolt stops, forcing it to rotate and lock.
Locking and unlocking are instigated by the bolt carrier, NOT the bolt.
The bolt is pushed and pulled by the carrier.