Why is the texture of my chocolate chip cookies foamy?
Your dough warmed up and the fat started to melt.  In between batches, keep the dough cold in the fridge.

Over-mixing the dough will also contribute to cake like cookies if a whole batch comes out like that.