Weak ergodicity breaking and quantum scars in constrained quantum systems