lib/types: prioritise coercedType in coercedTo
lib/types: prioritise coercedType in coercedTo

This more intuitively matches `types.either` and allows paths to be
coerced to submodules again, which was inhibited by #76861

NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs