I use a Python script to export an item to a FGDB, download said FGDB and then delete it. The script successfully deletes the FGDB, but when I go to the AGOL account, it is still there, and I am unable to remove it. When I try to delete the item I get:

And when I try to view the item in AGOL, I get:

Below is my script (some of which I got from another user on this forum, but I can't find the thread):
<SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>gis <SPAN class="keyword token">import</SPAN> GIS
<SPAN class="keyword token">from</SPAN> datetime <SPAN class="keyword token">import</SPAN> datetime
<SPAN class="keyword token">from</SPAN> pathlib <SPAN class="keyword token">import</SPAN> Path
<SPAN class="keyword token">from</SPAN> zipfile <SPAN class="keyword token">import</SPAN> ZipFile
<SPAN class="keyword token">import</SPAN> time<SPAN class="punctuation token">,</SPAN> os<SPAN class="punctuation token">,</SPAN> zipfile
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Initializing...\n'</SPAN><SPAN class="punctuation token">)</SPAN>
gis <SPAN class="operator token">=</SPAN> GIS<SPAN class="punctuation token">(</SPAN>site<SPAN class="punctuation token">,</SPAN>user<SPAN class="punctuation token">,</SPAN>pw<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Logged on...\n'</SPAN><SPAN class="punctuation token">)</SPAN>
fs <SPAN class="operator token">=</SPAN> gis<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'XXXXXXXXXXXXXXXXXXXXXXX'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN>f<SPAN class="string token">'Exporting Feature Service to FGDB - {fs.name}'</SPAN><SPAN class="punctuation token">)</SPAN>
fs<SPAN class="punctuation token">.</SPAN>export<SPAN class="punctuation token">(</SPAN>fs<SPAN class="punctuation token">.</SPAN>name<SPAN class="operator token">+</SPAN><SPAN class="string token">'_temp'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'File Geodatabase'</SPAN><SPAN class="punctuation token">,</SPAN>parameters<SPAN class="operator token">=</SPAN>None<SPAN class="punctuation token">,</SPAN>wait<SPAN class="operator token">=</SPAN><SPAN class="string token">'True'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># search for fgdb and get item id</SPAN>
<SPAN class="keyword token">while</SPAN> <SPAN class="token boolean">True</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">try</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Locating FGDB'</SPAN><SPAN class="punctuation token">)</SPAN>
search_fgb <SPAN class="operator token">=</SPAN> gis<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>search<SPAN class="punctuation token">(</SPAN>query<SPAN class="operator token">=</SPAN>fs<SPAN class="punctuation token">.</SPAN>name<SPAN class="operator token">+</SPAN><SPAN class="string token">'_temp'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN>search_fgb<SPAN class="punctuation token">)</SPAN>
fgb_item_id <SPAN class="operator token">=</SPAN> search_fgb<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN>id
fgdb <SPAN class="operator token">=</SPAN> gis<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN>fgb_item_id<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">break</SPAN>
<SPAN class="keyword token">except</SPAN> IndexError <SPAN class="keyword token">as</SPAN> e<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN>e<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'FGDB does not exist yet'</SPAN><SPAN class="punctuation token">)</SPAN>
data_path <SPAN class="operator token">=</SPAN> Path<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'./monthlyDownload'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="operator token">not</SPAN> data_path<SPAN class="punctuation token">.</SPAN>exists<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
data_path<SPAN class="punctuation token">.</SPAN>mkdir<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Downloading FGDB'</SPAN><SPAN class="punctuation token">)</SPAN>
fgdb<SPAN class="punctuation token">.</SPAN>download<SPAN class="punctuation token">(</SPAN>save_path<SPAN class="operator token">=</SPAN>data_path<SPAN class="punctuation token">)</SPAN>
<SPAN class="string token">'''while statement runs until a valid zipped file is created'''</SPAN>
<SPAN class="comment token">## randomly the output is a 1 KB file that is not a valid zipped file.</SPAN>
<SPAN class="comment token">## The while statement forces a valid zipped file to be created.</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Finalizing zip file'</SPAN><SPAN class="punctuation token">)</SPAN>
zipfullpath<SPAN class="operator token">=</SPAN>os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>join<SPAN class="punctuation token">(</SPAN>data_path<SPAN class="punctuation token">,</SPAN>fs<SPAN class="punctuation token">.</SPAN>name<SPAN class="operator token">+</SPAN><SPAN class="string token">"_temp.zip"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="comment token">#full path to the zipped file once it is downloaded to your computer</SPAN>
<SPAN class="keyword token">while</SPAN> zipfile<SPAN class="punctuation token">.</SPAN>is_zipfile<SPAN class="punctuation token">(</SPAN>zipfullpath<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">==</SPAN><SPAN class="token boolean">False</SPAN><SPAN class="punctuation token">:</SPAN>
fgdb<SPAN class="punctuation token">.</SPAN>download<SPAN class="punctuation token">(</SPAN>save_path<SPAN class="operator token">=</SPAN>data_path<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># delete temp FGDB in AGOL</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Deleting temporary FGDB'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">while</SPAN> <SPAN class="token boolean">True</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">try</SPAN><SPAN class="punctuation token">:</SPAN>
fgdb<SPAN class="punctuation token">.</SPAN>delete<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">except</SPAN> RuntimeError<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">break</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>