I've been using lightroom for a couple months now. I've been saving my photos to my desktop. I recently bought a new Nikon Z6 ii. When I put my CFExpress card in my computer, it didn't save them directly to my computer, and I formatted my card after import. All my pictures now say missing images, If i formatted my card before i put them onto my computer are they gone forever?
Depends on the kind of format, but most likely the photos are able to be recovered if it was a "standard" or low level format. If you are using Windows I recommend trying a program called Recuva. I'm unfamiliar with Mac OS and can't recommend a program, but any reputable hard drive data recovery program should work.
CFExpress cards work differently than other cards, as far as Lightroom Classic is concerned. CFExpress cards are considered to be the same as a hard disk for the purposes of LrC, and so you can (but should not) import as ADD, where the photos remain on the CFExpress card. So you have to be very careful to import using Copy (or Copy to DNG).
I believe if you imported using ADD and then formatted the CFExpress card, then your photos are gone.