According to the WASM spec, externref is an alias for (ref null extern).
While externref works well in .wat files (for wat2wasm), (ref null extern) doesn't seem to be supported, even with --enable-all:
error: unexpected token null, expected a numeric index or a name
The same error appears if I try to parse (ref extern) (without the null).