HPCC-8335 Fix example and internal error checking when cast no_null

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
HPCC-8335 Fix more issues with DEFAULT on field

Includes:
- Fix problems with checking the range of default values
- Use createExprAttr(defaultAtom) to avoid inconsistencies
- Preserve default when creating a simplified record

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>