USER>set json = [0,1,2]                                                                                     

USER>set json = [0,1,2], iter = json.%GetIterator()

USER>while iter.%GetNext(.key, .val){ write !,"[",key,"]=",val do:key=0 json.%Remove(key) }

[0]=0
[1]=2
USER>zw json
json=[1,2]  ; <DYNAMIC ARRAY>

And even with %Remove will not reach subsequent items

I think this may help

ClassMethod CleanNull(json As %DynamicObject) As %DynamicObject
{
  Set iter = json.%GetIterator()
  Set toRemove = ""
  While iter.%GetNext(.key, .value) {
    Set type = json.%GetTypeOf(key)
    If (type="null") {
      Set toRemove = toRemove _ $Listbuild(key)
    }
    ElseIf (type="object")||(type="array") {
      Set $Property(json, key) = ..CleanNull(value)
    }
  }
  Set ptr = 0, corr = 0
  While $Listnext(toRemove, ptr, key) {
    Do json.%Remove(key - corr)
    set corr = corr + 1
  }
  Return json
}

And Testing metho

ClassMethod TestJSON()
{
  set json = {
    "recipients": [ 
      { "name":"Utsavi", "email":"utsavi@gmail.com"},
      { "name":"Utsavi 1", "email":"utsavi1@gmail.com"},
      null, null
    ],
    "content":[null, {"title":"Test.pdf", "data":"ygwehfbnwfbhew"} ]
  }
  Set result = ..CleanNull(json)
  Do result.%ToJSON()
}

Will return this

{"recipients":[{"name":"Utsavi","email":"utsavi@gmail.com"},{"name":"Utsavi 1","email":"utsavi1@gmail.com"}],"content":[{"title":"Test.pdf","data":"ygwehfbnwfbhew"}]}

What the issue you faced?

Class User.Rest Extends %CSP.REST
{

XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ]
{
<Routes>
<Route Url="/:resource/(.*)" Method="GET" Call="GetResource" Cors="true"/>
<Route Url="/ping" Method="GET" Call="Ping" Cors="true"/>
</Routes>
}

ClassMethod Ping() As %String
{
  Write {"pong": true}.%ToJSON()
  Return $$$OK
}

ClassMethod GetResource(pResource As %String, pId As %String) As %Status
{
  Write {"resource": (pResource), "id": (pId)}.%ToJSON()
  Return $$$OK
}

}

With this REST class, I can do queries like this http://localhost:52773/rest/patient/test/123/456, with no issues it returns {"resource":"patient","id":"test/123/456"}

One more possibility is that the input Base64 stream has line breaks, which have to be omitted. And just read correct length would not be enough, it needs to remove all line breaks, truncate to the closest divisible by 4 length, and using the left tail with the next iteration. 

Periodically I see, that some systems may replace symbols such as "+" or "/" in Base64 with something like URL compatible.

Updated

Class CodeGolf.NatoTranslator
{

ClassMethod ToNato(i As %String) As %String
{
 s l="lfa,ravo,harlie,elta,cho,oxtrot,olf,otel,ndia,uliett,ilo,ima,ike,ovember,scar,apa,uebec,omeo,ierra,ango,niform,ictor,hiskey,ray,ankee,ulu"
 f j=1:1:$l(i){s k=$e(i,j),o=$g(o)_" "_$s(",.!?"[k:k,1:$zcvt(k,"U")_$p(l,",",$a(k)#32))} q $zstrip(o,"<=W")
}

ClassMethod Test(val = "If, you can read?") As %Status
{
  set res = ..ToNato(val)
  zw res
  #dim methodObj As %Dictionary.MethodDefinition
  set methodObj = ##class(%Dictionary.MethodDefinition).IDKEYOpen($ClassName(), "ToNato")
  Write !,"Size: ", methodObj.Implementation.Size
}

}

Size: 255