Can a GFCI be used as a disconnect?
A GFCI needs to be labeled as a disconnecting means to be used as one

A normal receptacle or deadfront GFCI is not labeled or listed for disconnecting use -- it won't kill you for abusing it that way, but it could lead to some premature wear on the GFCI's contacts, shortening its lifespan.

There are deadfront GFCIs that are listed and labeled for this task, but they are uncommon, and will have "ON" and "OFF" labeled on/near the buttons in addition to "RESET" and "TEST", as depicted below:



GFCI breakers are a different story though

However, a breaker-type GFCI is also a perfectly cromulent circuit breaker, and thus is considered a disconnecting means under the NEC even if it is not listed/labeled for SWD (Switching Duty) service.  (I know of no circumstance under the NEC where an appropriately rated circuit breaker, whether SWD listed/labeled or not, is not a legal disconnecting means.)