The expression return Modules\Machine\Entities\Machine::find($id) could return the type Illuminate\Database\Eloq...go\Abstracts\MongoModel which includes types incompatible with the type-hinted return Modules\Machine\Entities\Machine|null. Consider adding an additional type-check to rule them out.
The expression return $machine returns the type Illuminate\Database\Eloq...go\Abstracts\MongoModel which includes types incompatible with the type-hinted return Modules\Machine\Entities\Machine.