Hi there jamesdfromwindsor,
There are a few different reasons why your Apple Watch isn't recording your sleep occasionally. Have a look at the information below:
Apple Watch tracks your sleep based on the sleep schedule you create. Apple Watch can also track your sleep when your Sleep Focus starts. To receive sleep data from Apple Watch, it must track your sleep for at least four hours each night.
Learn more here: Track your sleep with Apple Watch - Apple Support
If this behavior persists, you'll want to reach out to Apple Support directly for further assistance. They're best-equipped to take a closer look at the issue and provide some additional guidance. This link will help you get started: Apple Support
Take care.