Limitations in P2WSH custom script
There is no restriction due to segwit, but witnesses are serialized differently than scriptSigs.

A scriptSig is a script on itself, which gets executed, and its resulting stack is then fed to the scriptPubKey (or redeemScript in case of P2SH). This is not the case for the witness: it is an encoding of the stack directly, without script involved.

That means that scriptSig can use opcodes like OP_3 (which pushes the byte array 0x03 onto the stack). In the witness, you'd need to serialize that byte array directly as 0x0103. The 0x01 there is not an opcode; it is just the length of the stack element.