I think this is a bug in go1.23, apparently fixed in go1.24. Here's my justification (sorry, somewhat long and full of language lawyerisms).
First note that in a shift expression, if the left-hand value is an untyped constant, it gets the type that it would have if the constant would have if the shift was omitted. Since the context is num >= (1 << bit) that means 1 gets the type uint16 -- the type of num.
From https://go.dev/ref/spec#Operators
The right operand in a shift expression must have integer type [Go 1.13] or be an untyped constant representable by a value of type uint. If the left operand of a non-constant shift expression is an untyped constant, it is first implicitly converted to the type it would assume if the shift expression were replaced by its left operand alone.
A constant expression isn't allowed to overflow or round except in some floating-point contexts, so if 1<<bit is a constant expression then the compiler error is correct; uint16(1) << 16 isn't valid it involves truncation (producing the value 0).
From https://go.dev/ref/spec#Constant_expressions
Constant expressions are always evaluated exactly; intermediate values and the constants themselves may require precision significantly larger than supported by any predeclared type in the language.
(I observe that the language here is ambiguous; there's something to be said for uint16(1) << 16 being evaluated exactly -- as 0, although I guess this is not the intention).
But, the language in the spec is quite clear about whether 1<<bit is a constant expression. From https://go.dev/ref/spec#Constant_expressions
Constant expressions may contain only constant operands and are evaluated at compile time.
So I think the error message reported by go1.23 is a mistake because 1<<bit is not a constant expression because bit is not a constant (as defined by the spec). My guess it's the result of an over-aggressive constant folding optimizer.
I had a quick skim through go issues from the go1.24 release period and didn't see any related fix, but perhaps I missed something.
go 1.25.3, I gettruein both cases and no compile error.