Since Go 1.21, the go directive in go.mod must be greater than or equal to the go directive for all dependencies.
Almost certainly, in the first case there's a dependency that specifies 1.23.0 and in the second case all dependencies are 1.23 or older.
Jason