Fieldmaps - _magnitude2.nii[.gz] is optional
As per these lines:

https://github.com/INCF/pybids/blob/800d15053952991c9cd4a00cf0039288d489ca12/bids/grabbids/bids_layout.py#L143-L148

when a fieldmap type is identified as `'phasediff'` then pybids understands that there is always a `_magnitude2.nii[.gz]` file. However, this is maked as optional in the specification.
diff --git a/bids/grabbids/bids_layout.py b/bids/grabbids/bids_layout.py
index a4b3dc34..e6a0df65 100644
--- a/bids/grabbids/bids_layout.py
+++ b/bids/grabbids/bids_layout.py
@@ -143,9 +143,11 @@ class BIDSLayout(Layout):
                         cur_fieldmap = {"phasediff": file.filename,
                                         "magnitude1": file.filename.replace(
                                             "phasediff", "magnitude1"),
-                                        "magnitude2": file.filename.replace(
-                                            "phasediff", "magnitude2"),
                                         "type": "phasediff"}
+                        magnitude2 = file.filename.replace(
+                            "phasediff", "magnitude2")
+                        if os.path.isfile(magnitude2):
+                            cur_fieldmap['magnitude2'] = magnitude2
                     elif file.type == "phase1":
                         cur_fieldmap["phase1"] = file.filename
                         cur_fieldmap["magnitude1"] = \\
['bids/grabbids/bids_layout.py']