In theory, yes, all things being equal etc. Even if you don’t bottom out the shorter travel is using a larger proportion of its travel for a given bump. Air springs aren’t linear so the resistance increases as you get further into the travel, which basically means that the shorter travel compresses less for a given bump, transferring more of the hit to the rider.
That’s obviously a simplistic description and linkage design will play a part, as will things like the damping on the shock, but in general a longer travel bike should still be more comfortable even if you aren’t riding it hard enough to bottom out the shock.