Some Points to note when applying a script to such records like lead, Case, etc.
- Always release the script to all users and roles, unless it will not work for users who create these records from online (Web Context). Same for Workflow
Online Case Form:
The following preference overrides customers/companies in Case form
Setup> Support> Case Profile> ANONYMOUS CUSTOMER – ONLINE FORM